|
Subject: Re: [xsl] Summary/Performance/Add Q: convert flat list w/ level information to a hierarcial one? From: David Tolpin <dvd@xxxxxxxxxxxxxx> Date: Wed, 3 Dec 2003 15:09:55 +0400 (AMT) |
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Summary/Performance/Add Q: c, Marcus Zelezny | Thread | [xsl] Dimitre's algorithm, fixed: q, David Tolpin |
| Re: [xsl] Re: HOWTO: convert flat l, David Tolpin | Date | Re: [xsl] Re: HOWTO: convert flat l, andrew . curry |
| Month |