Subject: Re: [xsl] Merging multiple documents and combining their nodes From: "Mark Peters" <flickrmeister@xxxxxxxxx> Date: Thu, 14 Jun 2007 11:38:31 -0400 |
After adding a comma in the following line to clear up one final error, I ran the stylesheet again without incident.
<?xml version="1.0" encoding="UTF-8"?> <components xmlns:exslt="http://exslt.org/common"/>
<files> <file>file1.xml</file> <file>file2.xml</file> <file>file3.xml</file> </files>
<components> <component name="a" description="1"> <childA>Value</childA> <childB>Value</childB> </component> </components>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common"> <xsl:output indent="yes"/> <xsl:template match="/"> <xsl:variable name="temp"> <components> <xsl:copy-of select="document(/files/file)/components/component"/> </components> </xsl:variable> <components> <xsl:for-each select="exslt:node-set($temp)/components/component[generate-id()=generate-id(key('c',@name))]"> <xsl:sort select="@name"/> (<xsl:copy> (<xsl:copy-of select="@*|key('c',@name)/*"/> </xsl:copy>) </xsl:for-each> </components> </xsl:template> <xsl:key name="c" match="component" use="@name"/> </xsl:stylesheet>
Thanks, Mark
There is a closing ')' missing, you need
exslt:node-set($temp)/components/component[generate-id()=generate-id(key('c',@name))]
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Merging multiple document, Martin Honnen | Thread | Re: [xsl] Merging multiple document, Martin Honnen |
[xsl] Embbeded postscript in xsl fo, Pekka Kleimert | Date | Re: [xsl] Merging multiple document, Martin Honnen |
Month |