[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: fallback parameter

Subject: Re: fallback parameter
From: J-P S <jps@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Sep 2004 08:50:06 +0100 (BST)
spanish foo
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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.