Subject: [xsl] Inserting parts of a xml document From: Martin Renner <m.renner@xxxxxxxxxx> Date: Wed, 11 Apr 2001 15:53:00 +0159 |
test1.xml <root> <a> <b> <name>node1</name> <option>true</option> </b> </a> </root>
test2.xml <root> <a> <b> <name>node2</name> <option>false</option> </b> </a> </root>
The result should be: <root> <a> <b> <name>node1</name> <option>true</option> </b> <b> <name>node2</name> <option>false</option> </b> </a> </root>
<xsl:template match="/"> <xsl:apply-templates /> </xsl:template>
<xsl:template match="root/a"> <xsl:apply-templates /> <xsl:copy> <xsl:apply-templates select="document('test2.xml')/root/a/node()" /> </xsl:copy> </xsl:template>
<!-- copy all significant parts --> <xsl:template match="node()|attribute::*"> <xsl:copy> <xsl:apply-templates select="node()|attribute::*" /> </xsl:copy> </xsl:template>
But with this xslt the "<a>" and "</a>" are just around the second "<b>": <root> <b> [data of "node1"] </b> <a> <b> [data of "node2"] </b> </a> </root>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XSL selection of apply te, Oliver Becker | Thread | Re: [xsl] Inserting parts of a xml , Jeni Tennison |
[xsl] XSL selection of apply templa, Moshe Eshel | Date | RE: [xsl] Un-escape and re-transfor, Robert C. Lyons |
Month |