This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
How to use Multi-value Variables?
- To: XSL-List at mulberrytech dot com
- Subject: How to use Multi-value Variables?
- From: David_Benua at percussion dot com
- Date: Sun, 16 Jul 2000 20:57:06 -0400
- Reply-To: xsl-list at mulberrytech dot com
I've been working on an XSLT Stylesheet that transforms one XML into another
(and I've been using Michael Kay's excellent book).
Here's what I'm trying to do:
In one section of the XML, I have a Node which specifies the connection
Parameters of a database
<Database>
<Driver>....</Driver>
<Server>....</Server>
<Owner>....</Owner>
<TableName>..... </TableName>
etc.
</Database>
I want to replace some (but not all) of these Nodes.
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" /> and get the value of the new server (as defined in
my variable).
The next problem is to build a template that matches all children of Database
that where there is also a child if $NewDBMS with the same name. It does not
seem that an <xsl:template match=... /> statement does not allow for variables.
I can, of course, make this work by creating specific templates for each child
of $NewDBMS, but I'm searching for a more generic approach.
Any suggestions?
Dave Benua
Percussion Software
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list