xsl-list
[Top] [All Lists]

[xsl] Move XML elements to one place using XSLT 2.0

2010-03-18 05:13:20
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>