[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: fallback parameter
On Wed, 22 Sep 2004, Jan Limpens wrote: ) In my xml I have areas marked with lang='somelanguage'. In my xslt I ) defined a parameter selectedLanguage (can be changed by user input) ) and a parameter defaultLanguage, that is used, when no content in the ) selected Language is available. Can't you just work with the one variable $somelanguage (capital l?) throughout? If you define somelanguage at the top of the stylesheet: <xsl:stylesheet ... > <xsl:param name="somelanguage" select="'en'"/> <xsl:template match="/"> Foo: <xsl:value-of select="$somelanguage"/> </xsl:template> </xsl:stylesheet> NOTE: double quotes around "'en'", otherwise it will take the value of the ELEMENT en, which doesn't exist. Then specifying it on the command line to e.g. saxon should cause it to be overridden e.g: > saxon test.xsl test.xsl Foo: en > saxon test.xsl test.xsl somelanguage=Spanish Foo: Spanish Cheers, J-P -- It is redundant to punish a girl who dyes her hair multiple colors. But if you feel it's absolutely necessary, I recommend a tattoo.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|