EDN Admin
Well-known member
Hi,
I am having a lot of realative path in my XSL which is taking a longer time to process, is there a way I can improve the performance. I can explain the scenario I have. I have say 2 excel sheets out of which I generate the XML, and it looks like this:
<EMPXML><br/>
<Sheet1XML><br/>
<Table><br/>
<EmpID>1</EmpID><br/>
<EmpName>Name1</EmpName><br/>
<EmpDesc>Desc1</EmpDesc><br/>
</Table><br/>
<Table><br/>
<EmpID>2</EmpID><br/>
<EmpName>Name2</EmpName><br/>
<EmpDesc>Desc2</EmpDesc><br/>
</Table><br/>
<Table><br/>
<EmpID>3</EmpID><br/>
<EmpName>Name3</EmpName><br/>
<EmpDesc>Desc3</EmpDesc><br/>
</Table><br/>
</Sheet1XML><br/>
<Sheet2XML><br/>
<Table><br/>
<EmpID>1</EmpID><br/>
<EmpName2>Name21</EmpName2><br/>
<EmpDesc2>Desc21</EmpDesc2><br/>
</Table><br/>
<Table><br/>
<EmpID>2</EmpID><br/>
<EmpName2>Name22</EmpName2><br/>
<EmpDesc2>Desc22</EmpDesc2><br/>
</Table><br/>
<Table><br/>
<EmpID>3</EmpID><br/>
<EmpName2>Name23</EmpName2><br/>
<EmpDesc2>Desc23</EmpDesc2><br/>
</Table><br/>
</Sheet2XML><br/>
</EMPXML>
Now in my XSL, I have like:
<xsl:for-each select="EMPXML/Sheet1XML/Table <br/>
<xsl:variable name="EmId <br/>
<xsl:value-of select="EmpID"/><br/>
</xsl:variable><br/>
...<br/>
...<br/>
<EmpDescription><br/>
<<xsl:value-of select="//EMPXML/Sheet2XML/Table[EmpID = $EmId]/EmpDesc2"/><br/>
</EmpDescription><br/>
</xsl:for-each>
This works perfectly, the problem is, I have many 4 such sheets and and within each sheet I have the Table portion(shown in XML above) like thousands(for each employee), and this eats up lot of time. I loop through one sheet , and for the value from
the rest of the sheets I have the relative path. And this takes a lot of time to process the XSL, but I get the desired result, is there a way to improve the performance? For some XSL where I do not have much relative paths the processing is pretty fast.
<hr class="sig Rpaul
View the full article
I am having a lot of realative path in my XSL which is taking a longer time to process, is there a way I can improve the performance. I can explain the scenario I have. I have say 2 excel sheets out of which I generate the XML, and it looks like this:
<EMPXML><br/>
<Sheet1XML><br/>
<Table><br/>
<EmpID>1</EmpID><br/>
<EmpName>Name1</EmpName><br/>
<EmpDesc>Desc1</EmpDesc><br/>
</Table><br/>
<Table><br/>
<EmpID>2</EmpID><br/>
<EmpName>Name2</EmpName><br/>
<EmpDesc>Desc2</EmpDesc><br/>
</Table><br/>
<Table><br/>
<EmpID>3</EmpID><br/>
<EmpName>Name3</EmpName><br/>
<EmpDesc>Desc3</EmpDesc><br/>
</Table><br/>
</Sheet1XML><br/>
<Sheet2XML><br/>
<Table><br/>
<EmpID>1</EmpID><br/>
<EmpName2>Name21</EmpName2><br/>
<EmpDesc2>Desc21</EmpDesc2><br/>
</Table><br/>
<Table><br/>
<EmpID>2</EmpID><br/>
<EmpName2>Name22</EmpName2><br/>
<EmpDesc2>Desc22</EmpDesc2><br/>
</Table><br/>
<Table><br/>
<EmpID>3</EmpID><br/>
<EmpName2>Name23</EmpName2><br/>
<EmpDesc2>Desc23</EmpDesc2><br/>
</Table><br/>
</Sheet2XML><br/>
</EMPXML>
Now in my XSL, I have like:
<xsl:for-each select="EMPXML/Sheet1XML/Table <br/>
<xsl:variable name="EmId <br/>
<xsl:value-of select="EmpID"/><br/>
</xsl:variable><br/>
...<br/>
...<br/>
<EmpDescription><br/>
<<xsl:value-of select="//EMPXML/Sheet2XML/Table[EmpID = $EmId]/EmpDesc2"/><br/>
</EmpDescription><br/>
</xsl:for-each>
This works perfectly, the problem is, I have many 4 such sheets and and within each sheet I have the Table portion(shown in XML above) like thousands(for each employee), and this eats up lot of time. I loop through one sheet , and for the value from
the rest of the sheets I have the relative path. And this takes a lot of time to process the XSL, but I get the desired result, is there a way to improve the performance? For some XSL where I do not have much relative paths the processing is pretty fast.
<hr class="sig Rpaul
View the full article