[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to use Multi-value Variables?
> I've defined a variable: > <xsl:variable name="NewDBMS"> > <Driver>....</Driver> > <Server>....</Server> > <Owner>.....</Owner> > </xsl:variable> > > This variable works fine, in that I can take the <xsl:value-of > select="$NewDBMS/Server" /> If this works, then you're probably using MSXML3, because it relies on the implicit conversion of a result tree fragment to a node-set. XSLT 1.0 specifically states that the "/" path operator can't be used with a result-tree-fragment argument. > The next problem is to build a template that matches all > children of Database ... where there is also a child [of] $NewDBMS with the same > name. It [seems] that an <xsl:template match=... /> statement does not > allow for variables. Correct, variables can't be used in template rules. This is to prevent recursion: a global variable declaration might invoke the template, so which comes first? The match pattern must be fixed "at compile time", it can't depend in any way on the source document. It might be possible to achieve what you want using the name() function, but that doesn't help much because you'd probably want to compare the name with a variable. Mike Kay PS glad you like the book XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|