G
Guest
Hi,
I hope my question is not too trivial. But I have an annoying performance
issue with xslt. I must create an xml file from multiple source files. I
made a catalog of these files:
catalog.xml:
<files>
<file>file1.xml</file>
<file>file2.xml</file>
</files>
each file has the same structure (about 2 KB):
<a>
<test>abcd</test>
</a>
(The tree is more complicated than that).
and then i process this catalog file by this xslt:
test.xsl:
<xsl:template match="files">
<results>
<xsl:apply-templates select="document(file)"/>
</results>
</xsl:template>
<xsl:template match="a">
<result a="{test}"/>
</xsl:template>
(it's the exact template, I don't do anything fancier within the template,
just selecting direct children of the root node of each file).
My problem is that my catalog file has more than 100,000 <file> elements.
xsltproc takes up to 700 MB to deal with the file and saxon gives up after
the first hundred elements with a java.lang.OutOfMemory error.
I have done something wrong?
Thanks for your help
J.
I hope my question is not too trivial. But I have an annoying performance
issue with xslt. I must create an xml file from multiple source files. I
made a catalog of these files:
catalog.xml:
<files>
<file>file1.xml</file>
<file>file2.xml</file>
</files>
each file has the same structure (about 2 KB):
<a>
<test>abcd</test>
</a>
(The tree is more complicated than that).
and then i process this catalog file by this xslt:
test.xsl:
<xsl:template match="files">
<results>
<xsl:apply-templates select="document(file)"/>
</results>
</xsl:template>
<xsl:template match="a">
<result a="{test}"/>
</xsl:template>
(it's the exact template, I don't do anything fancier within the template,
just selecting direct children of the root node of each file).
My problem is that my catalog file has more than 100,000 <file> elements.
xsltproc takes up to 700 MB to deal with the file and saxon gives up after
the first hundred elements with a java.lang.OutOfMemory error.
I have done something wrong?
Thanks for your help
J.