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

How to implement Divide and Conquer Algo on this templ

Subject: How to implement Divide and Conquer Algo on this template !! Getting Callstack overflow error
From: Dipesh Khakhkhar <dkhakhkh@xxxxxxxxxxxxxxx>
Date: Thu, 18 Sep 2003 19:34:49 -0400
xsl divide
Hi,

The is regarding Callstack overflow error.

Dimitrie suggested to implement Divide and Conquer Solution to avoid such a 
problem.

I saw his example at this site.
http://www.topxml.com/code/default.asp?p=3&id=v20020107050418


How do i write DVC algorithm for the following Call-Template. Here I am having 
data also in the parameter. And my input file is going to be in GBs and every 
time the "names" param in the following snippet is going to huge number atlest 
more than 1000 as there are 10 attributes in each node and there will be 1000 
or more nodes like that.

I am trying to get unique attribute names for say node "SecondNode" which can 
repeat any number of times.

<!-- Getting all possible attribute names for SecondName -->
xsl:variable name="ResColNames" select="/Root/FirstNode/SecondNode/@*"/>

<!-- Calling template to get unique names with delimiter -->
xsl:variable name="uniqueColumnNamesRes">
<xsl:call-template name="findUniqueNamesForNodesWithAtt">
<xsl:with-param name="names" select="$ResColNames"/>
<xsl:with-param name="uniqueNames"/>
<xsl:with-param name="i">0</xsl:with-param>
</xsl:call-template>
</xsl:variable>

The following is the template which is called.

<!-- This is to find unique Attribute Names for SecondNode --> <xsl:template 
name="findUniqueNamesForNodesWithAtt">
<xsl:param name="names"/>
<xsl:param name="uniqueNames"/>
<xsl:param name="i"/>
<xsl:choose>
<xsl:when test="$i &lt;= count($names)">
<xsl:variable name="newUniqueName">
<xsl:choose>
<xsl:when test="contains($uniqueNames, name($names[$i]))">
<xsl:value-of select="$uniqueNames"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($uniqueNames,'`',name($names[$i]))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="findUniqueNamesForNodesWithAtt">
<xsl:with-param name="names" select="$names"/>
<xsl:with-param name="uniqueNames" select="$newUniqueName"/>
<xsl:with-param name="i" select="$i + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($uniqueNames,'`')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


In the above Called template how do i use Divide and Conquer algorithm. My 
whole solution is relying on this kind of template only so if somebody please 
show me how to implement DVC algorithm it will be highly appreciated.

Thanks in the anticipation that I will get some reply from you.

Eagerly waiting for your reply.

Regards,
Dipesh


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.