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

Move XML elements to one place using XSLT 2.0

Subject: Move XML elements to one place using XSLT 2.0
From: Jacobus Reyneke <jacobusreyneke@xxxxxxxxx>
Date: Thu, 18 Mar 2010 12:12:51 +0200
 Move XML elements to one place using XSLT 2.0
Good day,

This is a low priority request, but if someone has the time, please have a look.

I have an XML document that outputs to XSL-FO using XSL 2.0.  All was
well and happy until I tried to move all my notes in the XML file into
an Appendix (they currently appear structurally in the same place on
input and output). It's now a whole bottle or red wine later, but I
still don't have the answer (pleeshh helpsh me)

I'm trying to change this:
<root>
<a>
   <note>aaaa</note>
   <b>
       <note>bbbbb</note>
    </b>
    <c>
       <note>cccc</note>
    </c>
</a>
</root>

Into:
<root>
<a>
   <b>
    </b>
    <c>
    </c>
</a>
 <note>aaaa</note>
 <note>bbbbb</note>
 <note>cccc</note>
</root>

Here comes the difficult part: How can I change the following style
sheet to do the re-shuffling without touching the first three
templates. Currently input and output structure is the same. Now I
need to grab the 'notes' and put them in one place but without
affecting the rest of my xslt.

<xsl:template match="a">
........
</xsl:template>
<xsl:template match="b">
........
</xsl:template>
<xsl:template match="c">
........
</xsl:template>
<xsl:template match="note">
........
</xsl:template>

Kind regards,
Jacobus

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.