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

Re: Summary/Performance/Add Q: convert flat list w/ l

Subject: Re: Summary/Performance/Add Q: convert flat list w/ level informationto a hierarcial one?
From: David Tolpin <dvd@xxxxxxxxxxxxxx>
Date: Wed, 3 Dec 2003 15:09:55 +0400 (AMT)
tricky algorithms
Marcus,

thanks a lot for the nice subject; I've learned a lot while thinking about it.

> 2. what I learned - surprisingly for me - there is not need for item/container tags!?

If there is a requirement that an entry is atomic regardless of the following elements
if it has item tag, then it has to be processed. For example

  <items>
    <item type="i" level="0"/>
    <item type="i" level="1"/>
  </items>

will be turned into

  <items>
    <item type="i" level="0">
      <item type="i" level="1"/>
    </item>
  </items>

by the proposed algorithms. 

If it has to be
  <items>
    <item type="i" level="0"/>
    <item type="i" level="1"/>
  </items>

because these are items and not containers, then the algorithms will have to be modified.

> 
> 3. regarding performance
> 
> The typical number of <node>'s ranges btw 100-3000, w/ max. level btw. 3-7

Whether a particular algorithm suits your needs depends on your performance
requirements and robustness of your equipment and software. If a 100 nodes
document is processed in 1 ms, and each 50 nodes increase the time three times,
then the 3000 nodes set will be processed in
3^((3000-100)/50)=4710128697246244834921603689 ms, which is approximately
149357201206438509 years.

> 4. additional question:
> 
> Can your tricky algorithms also deal with my real situation:
> From:
> <items>
>  <item type="c" name="toplevel"><level>0</level></item>
>  <item type="i" name="1. item"><level>1</level></item>
>  <item type="c" name="2. container"><level>1</level></item>
>  <item type="i" name="2.1 item"><level>2</level></item>
>  <item type="i" name="2.2 item"><level>2</level></item>
>  <item type="i" name="3. item"><level>1</level></item>
>  <item type="c" name="4. container"><level>1</level></item>
>  <item type="i" name="4.1 item"><level>2</level></item>
>  <item type="c" name="4.2 container"><level>2</level></item>
>  <item type="i" name="4.2.1 item"><level>3</level></item>
> </items>
> To:
> Same output desired

Yes, elements are isomorphic to attributes in this content. Change all 
occurences of '/@level' to '/level' in either of them.

David

 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.