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

Re: Re: Using a variable in XSLT

Subject: Re: Re: Using a variable in XSLT
From: Tim Müller-Seydlitz <tms@xxxxxxxxxxxxxxxxxx>
Date: Wed, 03 Sep 2003 09:48:48 +0200
variable en xslt
Hi David,
thanks very much. Let me detail my inquiry further.

You can not use variables in match expressions in XSLT 1.

However you appear to be confused:

However xsl:variable is a node set and not a string


Variables may contain either node sets or strings (or other things) but
your variable

<xsl:variable name="SystemSelected" select='"sys:one"' />


contains a string.

Without seeing your source file it's rather hard to guess what your
intended processing is, but possibly something like

<xsl:template match="xs:documentation">
<xsl:choose>
  <xsl:when test="lang('de') and *[name()="$SystemSelected]">
    ....



Actually I would like to process something like this:

	<xs:element name="account" type="Account">
		<xs:annotation>
			<xs:documentation xml:lang="en">This is the English general description
				<sys:one>That's the special purpose description for system 1</sys:one>
				<sys:two>That's the special purpose description for system 2</sys:two>
                       </xs:documentation>
			<xs:documentation xml:lang="de">Das ist die deutsche allgemeneine Beschreibung.
				<sys:one>Das ist die spezielle Beschreibung für System 1</sys:one>
				<sys:two>Das ist die spezielle Beschreibung für System 2</sys:two>			</xs:documentation>
		</xs:annotation>
	</xs:element>

From this structure I want to select the special purpose documentation for system one and later for system two.
As both selection are very similar I would like to use a variable in an XSLT style sheet that lets me either choose sys:one or sys:two.

Regards





XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.