Subject: Re: [xsl] Identical entries in different input documents should appear in the output document only once From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Fri, 07 Sep 2007 22:27:57 +0200 |
At 2007-09-07 17:54 +0200, Meyer, Roland 1. (NSN - DE/Germany - MiniMD) wrote:I have the following problem. I have a couple of XML documents to merge to one output document. Each document has the same structure like this: [..........].
Is there any other and simpler way to - let's say - memorize the already written blocks resp. identifiers?
Mike is correct that the variable-based grouping method would work with this, but it is far slower than an XSLT 2 approach. When using XSLT 1.0 I find variable-based grouping acceptable for sub-document and multi-document grouping.
The code would work along the lines of the following, and it assumes that there is an XML structure $files with the list of all the file names:
<xsl:variable name="items" select="document($files/file/@uri,.)/root/block"/> <xsl:for-each select="$items"> <!--walk through all, doing work at first of each unique idTag--> <xsl:if test="generate-id(.)= generate-id($items[idTag=current()/idTag])"> <!--the following executes once for each unique idTag value across all the files--> </xsl:if> </xsl:for-each>
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Identical entries in diff, Abel Braaksma | Thread | RE: [xsl] Identical entries in diff, Meyer, Roland 1. (NS |
Re: [xsl] Identical entries in diff, Abel Braaksma | Date | RE: [xsl] Identical entries in diff, Meyer, Roland 1. (NS |
Month |