| Subject: [xsl] Transformation Grouping Problem  (XSLT 2.0, Saxon-PE  9.3.0.5) From: Raymond Lillibridge <RLillibridge@xxxxxxxxxxxx> Date: Fri, 16 Sep 2011 14:44:21 +0000 | 
Good Day to all!
I'm in need of some assistance with group logic using XSLT 2.0.
Given the following sample xml file as input:
<book>
            <title>My Book Title</title>
            <para>book Blah, blah, blah</para>
            <para>book Dah, dah, dah</para>
            <para>book Lah, lah, lah</para>
            <level1>
                        <title>level1 AAA</title>
                        <para>level1 Blah, blah, blah</para>
                        <para>level1 Dah, dah, dah</para>
                        <para>level1 Lah, lah, lah</para>
                        <level2>
                                    <title>level2 AAA</title>
                                    <para>level2 Blah, blah, blah</para>
                                    <para>level2 Dah, dah, dah</para>
                                    <para>level2Lah, lah, lah</para>
                                    <level3>
                                                <title>level3 AAA</title>
                                                <para>level3 Blah, blah, bl=
ah</para>
                                                <para>level3 Dah, dah, dah<=
/para>
                                                <para>level3 Lah, lah, lah<=
/para>
                                    </level3>
                                    <level3>
                                                <title>level3 AAA</title>
                                                <para>level3 Blah, blah, bl=
ah</para>
                                                <para>level3 Dah, dah, dah<=
/para>
                                                <para>level3 Lah, lah, lah<=
/para>
                                    </level3>
                        </level2>
            </level1>
</book>
using 'for-each-group'  I can group by the different levels, but how can I =
isolate just the 'top' content of the <book> or  <level#>?
For instance, I'd like to create an XML result-document that contains only:
<book>
            <title>My Book Title</title>
            <para>book Blah, blah, blah</para>
            <para>book Dah, dah, dah</para>
            <para>book Lah, lah, lah</para> </book>
...and another XML result-document that contains only:
<level1>
            <title>level1 AAA</title>
            <para>level1 Blah, blah, blah</para>
            <para>level1 Dah, dah, dah</para>
            <para>level1 Lah, lah, lah</para> </level1>
...&c.
Cheers,
Raymond Lillibridge
Sr. Software Engineer
Municipal Code Corporation
www.municode.com
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [xsl] RE: Best way to represent, Michael Kay | Thread | Re: [xsl] Transformation Grouping P, Andrew Welch | 
| Re: [xsl] Best way to represent an , Andrew Welch | Date | Re: [xsl] Transformation Grouping P, Andrew Welch | 
| Month |