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

Re: How to implement Divide and Conquer Algo on this t

Subject: Re: How to implement Divide and Conquer Algo on this template !! Getting Callstack overflow error
From: Dipesh Khakhkhar <dkhakhkh@xxxxxxxxxxxxxxx>
Date: Fri, 19 Sep 2003 13:46:42 -0400
conquer names
Hi,

To avoid the Callstack error for huge input files. I have to change my 
algorithm to find unique names. I do it for finding unique attribute names and 
unique attribute values.

Now using Munechian method how do i find unique values for the TableName and 
for each TableName how do i find unique ColumnName in the following xml.

Input
-----


<Root>
<FNode>
<SNode>
<Table TableName="fName>
  <Row>
   <Column Name="ColName1"/>
   <Column Name="ColName2"/>
  </Row>
  <Row>
   <Column Name="ColName1"/>
   <Column Name="ColName3"/>
   <Column Name="ColName4"/>
  </Row>
</Table>
<Table TableName="SecondTname">
<Row>
   <Column Name="ColName1"/>
   <Column Name="ColName2"/>
   <Column Name="ColName3"/>
   <Column Name="ColName4"/>

  </Row>
  <Row>
   <Column Name="ColName1"/>
   <Column Name="ColName5"/>
   <Column Name="ColName6"/>
  </Row>
</Table>
</SNode>
<SNode>
<Table TableName="fName>
  <Row>
   <Column Name="ColName1"/>
   <Column Name="ColName2"/>
  </Row>
  <Row>
   <Column Name="ColName1"/>
   <Column Name="ColName5"/>
   <Column Name="ColName6"/>
  </Row>
</Table>
<Table TableName="SecondTname">
  <Row>
   <Column Name="ColName2"/>
   <Column Name="ColName3"/>
  </Row>
  <Row>
   <Column Name="ColName7"/>
   <Column Name="ColName8"/>
  </Row>
</Table>
<Table TableName="ThirdTname">
  <Row>
   <Column Name="ColName1"/>
   <Column Name="ColName2"/>
  </Row>
 </Table>
</SNode>
</FNode>
</Root>


There can be any number of Table nodes within SNode and there will be any 
number of SNodes within FNode.

My previous logic was to find the unique table names and then for each table 
name find unique Column names. As pointed out, I was using inefficient code to 
the same, it was working fine when there were limited number of Table nodes 
but i got Callstack overflow error when number of Table node increased. As 
Dimitre told, then i moved to implement grouping using xsl:key.

I am formin xml file as output. For the above xml file the output  will be

Desired output
--------------

<Root>
<Tables>
<Table Name="FNode">
<!-- Here column node corresponding to unique attribute names for FNode will 
be written. For simplicity this is dropped from the current xml. I am able to 
get this output -->
</Table>
<!-- Similarly for second table -->
<Table Name="SNode">
</Table>
<Table Name="fName">
<Column Name="ColName1"/>
<Column Name="ColName2"/>
<Column Name="ColName3"/>
<Column Name="ColName4"/>
<Column Name="ColName5"/>
<Column Name="ColName6"/>
</Table>
<Table Name="SecondTname">
<Column Name="ColName1"/>
<Column Name="ColName2"/>
<Column Name="ColName3"/>
<Column Name="ColName4"/>
<Column Name="ColName5"/>
<Column Name="ColName6"/>
<Column Name="ColName7"/>
<Column Name="ColName8"/>
</Table>
<Table Name="ThirdTname">
<Column Name="ColName1"/>
<Column Name="ColName2"/>
</Table>
</Tables>
</Root>

I hope, I am clear in explaining my problem.

Any help to get the solution in efficent way will be highly appreciated. I 
wrote the solution but it is not efficient thats why i have to change the 
entire xsl now.

Eagerly waiting for 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.