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

nested groups from flat file

Subject: nested groups from flat file
From: "Szabo, Patrick (LNG-VIE)" <patrick.szabo@xxxxxxxxxxxxx>
Date: Tue, 8 Apr 2014 06:12:35 +0000
 nested groups from flat file
Hi,

I'm using XSLT 2.0 and Saxon 9.3.
I have a flat markup and need to give it some structure.

Examplary markup

<a>...</a>
<b>...</b>
<c>...</c>
<d>...</d>
<e>...</e>
<d>...</d>
<d>...</d>

Desired result:

<layera>
      <a>...</a>
      <layerb>
             <b>...</b>
             <layerc>
                <c>...</c>
                <layerd>
                        <d>...</d>
                        <e>...</e>
                </layerd>
                <layerd>
                        <d>...</d>
                </layerd>
                 <layerd>
                        <d>...</d>
                </layerd>
        </layerc>
     </layerb>
</layera>

So I know where a new "layer" oft he strcture starts (it's a little more
complicated but I simplified it to fit in an email) but I don't know how to
wrap things like this.

I've tried nested groupings while always checking if there is a nother layer
following but that seems very cumbersome and not elegant at all.

I've also tried matching the starts of layers and working with modes to wrap
things but that get's very messy very quick and doesn't really work as
intended either.

Is there a best practive to do this ? Maybe a feature of for-each-group that
I'm unaware of ?

regards


. . . . . . . . . . . . . . . . . . . . . . . . . .
Ing. Patrick Szabo
Developer
LexisNexis
A-1030 Wien, Marxergasse 25

mailto:Patrick.Szabo@xxxxxxxxxxxxx
Tel.: +43 1 53452 1514
Fax.: +43 1 534 52 146

. . . . . . . . . . . . . . . . . . . . . . . . . .

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.