[xsl] flatten XML tree

Subject: [xsl] flatten XML tree
From: Robert Sösemann <robert.soesemann@xxxxxx>
Date: Mon, 18 Mar 2002 17:19:53 +0100
Hello,

how can I flatten my XML like that?

This is the source:

<archive>
    <issue>
        <number>2</number>
        <topic>Genetic Diseases</topic>
        <articles>
            <article>
                <title>The magic of DNA</title>
                <author>Ronald Mueller</author>
                <keywords>genetics,dna</keywords>
            </article>
            <article>
                <title> DNA demystified</title>
                <author>Arnold Breed</author>
                <keywords>genetics,dna</keywords>
            </article>
            *many articles*
        </articles>
    </issue>
    *many magazines*
</archive>

and I want:

<archive>
            <article>
                <number>2</number>
                <topic>Genetic Diseases</topic>
                <title>The magic of DNA</title>
                <author>Ronald Mueller</author>
                <keywords>genetics,dna</keywords>
            </article>
            <article>
                <number>2</number>
                <topic>Genetic Diseases</topic>
                <title> DNA demystified</title>
                <author>Arnold Breed</author>
                <keywords>genetics,dna</keywords>
            </article>
    *many articles*
</archive>

All that I want to define is that I only want the root and an amount of
article nodes.
The children of article can stay as they are.
All ancestors like number and topic that semantically belong also to an
article schould became direct childs of article.

Would that be possible? And could this even be undone?

Thanks in advance.

Rob
............................................................................
..........
 ROBERT SÖSEMANN  (robert.soesemann@xxxxxx)

 schwärzlocherstr. 29/1 | 72070 tübingen
 tel : 07071 / 400 880

 icq# : 100 467 870
 pgp-keys : www.webspace-journey.de/pgp.asc
............................................................................
..........


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


Current Thread