[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Merging 2 XML's in to 1 output XML (Performance Issue)

Subject: Merging 2 XML's in to 1 output XML (Performance Issue)
From: "Kusunam, Srinivas" <SKusunam@xxxxxxxx>
Date: Wed, 12 Oct 2005 10:51:56 -0400
xml append node performance
Hi Group,

         This is my first message in this group. Looks like group is
very active and helpful please suggest me something on this.


I have InputXSL1   & InputXML2 which needs to be combined in to
OutputXML based on some conditions say for each record in InputXSL1 with
Key match in InputXSL2 get all the  child elements in InputXSL2 and
append to InputXSL1's Node.

Size of Input Files can go up to 100MB (MAX).
Environment:   JDK-1.4.2_06   \   xalan-j_2_7_0

I have written simple Style sheet to do this but to process 10MB file it
is taking around 14mins and which is definitely not acceptable. Please
suggest me if this is common with XSLT (as everybody say that XSLT is
not efficient for Large Input files). What are the alternatives to do
this?

InputXSML1:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<st:VehicleTDoc>

	<st:VehicleTT>
		<xdd:DFFileId>213044</xdd:DFFileId>
		<xdd:RSNo>10</xdd:RSNo>
		<xdd:SNameAddGroup>
			<xdd:SAddRoleCode>P</xdd: SAddRoleCode >
		</xdd:SNameAddGroup>
	</st: VehicleTT >
</st: VehicleTDoc>

InputXML2:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<st:VehicleTDoc>

	<st:VehicleTT>
		<xdd:DFFileId>213044</xdd:DFFileId>
		<xdd:RSNo>10</xdd:RSNo>
		<xdd:SName>
			<xdd:RoleCode>Primary</xdd:RoleCode>
		</xdd:SName>
	</st: VehicleTT >
</st: VehicleTDoc>

XSL:
<xsl:stylesheet version="1.0">

<xsl:output method="xml" indent="yes" />

<xsl:variable name="aggregator" select="document('InputXML2.xml')" />

<xsl:template match="/">
	<st:VehicleTDoc>
  		<xsl:apply-templates/>
	</st:VehicleTDoc>
</xsl:template>

<xsl:template match="//st:VehicleTT">

    <st:VehicleTT>
	    <xsl:copy-of select="*"/>
    <xsl:apply-templates
select="$aggregator/st:VehicleTDoc/st:VehicleTT[xdd:DFFileId=current()/x
dd:DFFileId and xdd:RSNo=current()/xdd:RSNo][1]/xdd:SName" />
    </st:VehicleTT>
</xsl:template>

<xsl:template match="xdd:SName">
	<xsl:copy-of select="current()" />
</xsl:template>

</xsl:stylesheet>

Instead of hard coding some of the tags I can actually get it from the
current node but my main problem is performance of the main task. Looks
like this call is taking lot of time......
xsl:apply-templates
select="$aggregator/st:VehicleTDoc/st:VehicleTT[xdd:DFFileId=current()/x
dd:DFFileId and xdd:RSNo=current()/xdd:RSNo][1]/xdd:SName" />

I really appreciate any comments and suggestions.

Thanks,
Sree

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.