Subject:Performance issue with xml Author:Emile Hermans Date:01 Aug 2005 02:39 AM
Hello,
We have the following issue.
We have an input XML that is like this structure:
<root>
<guid>
<item>
<guid>1234567901234567890123456789012</guid>
</item>
<item>
<guid>2345679012345678901234567890123</guid>
</item>
...etc
</guid>
<header>
<item>
<ref_guid>1234567901234567890123456789012</ref_guid>
<headernumber>5678</headernumber>
....all header info of thisguid
...
</item>
<item>
<ref_guid>2345679012345678901234567890123</ref_guid>
<headernumber>7891</headernumber>
....all header info of thisguid
...
</item>
...etc.
</header>
<salesinfo>
<item>
<ref_guid>1234567901234567890123456789012</ref_guid>
<salesunit>pieces</salesunit>
....all sales info of thisguid
...
</item>
<item>
<ref_guid>2345679012345678901234567890123</ref_guid>
<salesunit>boxes</salesunit>
....all sales info of thisguid
...
</item>
...etc
</salesinfo>
<text>
<item>
<ref_guid>1234567901234567890123456789012</ref_guid>
<text>this is textline of guid 1234567901234567890123456789012</text>
</item>
<item>
<ref_guid>1234567901234567890123456789012</ref_guid>
<text>this is 2nd textline of guid 1234567901234567890123456789012</text>
</item>
<item>
<ref_guid>2345679012345678901234567890123</ref_guid>
<text>this is textline of guid 2345679012345678901234567890123</text>
</item>
<item>
<ref_guid>2345679012345678901234567890123</ref_guid>
<text>this is 2nd textline of guid 2345679012345678901234567890123</text>
</item>
...etc
</text>
....
additonal data (partner info etc.. )
</root>
Result xml must be something like:
<resultroot>
<groupedguid>
<guid>1234567901234567890123456789012</guid>
<headernumber>5678</headernumber>
....
<salesunit>pieces</salesunit>
....
<text>this is textline of guid 1234567901234567890123456789012</text>
....
</groupedguid>
<groupedguid>
<guid>1234567901234567890123456789012</guid>
<headernumber>7891</headernumber>
....
<salesunit>boxes</salesunit>
....
<text>this is textline of guid 22345679012345678901234567890123</text>
....
</groupedguid>
</resultroot>
Header, sales and text information are illustrative there are some 6 additional sets (ie partner info) in the same xml that are selected exactly the same way.
When our input xml becomes relatively large (> 5 mb) with approximately 400 GUIDS we run into performance/memory problems.
Is there a more efficient way to get the same result xml.
Or does anybody have some other suggestions to improve performance.
<!-- additonal sets of data selected with additional for-each elements -->
</groupedguid>
</xsl:for-each>
</resultroot>
</xsl:template>
</xsl:stylesheet>