This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Recursively link XML blocks
- From: ronald heller <ronald at salience dot nl>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 21 Nov 2001 11:06:53 +0100
- Subject: Re: [xsl] Recursively link XML blocks
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
would this suffice?
XML:
<document>
<element_A>
textA textA textA
<insert>element_B</insert>
textA textA textA
</element_A>
<element_B>
textB textB textB
<insert>element_C</insert>
textB textB textB
</element_B>
<element_C>
textC textC textC
textC textC textC
</element_C>
</document>
XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="document">
<xsl:apply-templates select="*[1]"/>
</xsl:template>
<xsl:template match="insert">
<xsl:variable name="element" select="."/>
<xsl:apply-templates select="/document/*[name()=$element]"/>
</xsl:template>
</xsl:stylesheet>
Cheers,
RH
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list