Thanks Andrew,, that works well,,
On Mon, Aug 15, 2011 at 8:03 PM, Andrew Welch
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
On 15 August 2011 21:00, Alex Muir
<alex(_dot_)g(_dot_)muir(_at_)gmail(_dot_)com> wrote:
Hi given the following
<group xml:id="MILHIS_Yes">
<name>Yes</name>
</group>
<group xml:id="MILHIS_Vehicles">
<name>Vehicles</name>
</group>
<group xml:id="MILHIS_Air">
<name>Air</name>
</group>
<group xml:id="MILHIS_Aeroplane">
<name>Aeroplane</name>
</group>
<item xml:id="MILHIS_Attack_Aircraft">
<name>Attack Aircraft</name>
</item>
I'm trying to convert it to without any success.
<group xml:id="MILHIS_Yes">
<name>Yes</name><group xml:id="MILHIS_Vehicles">
<name>Vehicles</name>
<group xml:id="MILHIS_Air">
<name>Air</name>
<group xml:id="MILHIS_Aeroplane">
<name>Aeroplane</name>
<item xml:id="MILHIS_Attack_Aircraft">
<name>Attack Aircraft</name>
</item>
</group>
</group>
</group>
</group>
How do you do this in xslt assuming you could have any number of
groups followed by 1 item?
<xsl:template match="/">
<xsl:apply-templates select="/path/to/group[1]"/>
</
then within the group template, apply-templates to the next sibling, or item:
<xsl:template match="group">
<xsl:copy>
<xsl:copy-of select="node()"/>
<xsl:apply-templates select="following-sibling::*[1][self::group
or self:item]"/>
</
</
--
Andrew Welch
http://andrewjwelch.com
--~------------------------------------------------------------------
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>
--~--
--
Alex Muir
Instructor | Program Organizer - University Technology Student Work
Experience Building
University of the Gambia
http://sites.utg.edu.gm/alex/
Low budget software development benefiting development in the Gambia,
West Africa
Experience of a lifetime, come to Gambia and Join UTSWEB -
http://sites.utg.edu.gm/utsweb/
--~------------------------------------------------------------------
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>
--~--