Subject: Re: [xsl] flat xml tree to indent one From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 21 Dec 2010 12:47:12 +0000 |
<p foo="foo_att" bar="bar_att" foobar="foobar_att">my text</p><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="p"> <p> <xsl:apply-templates select="." mode="x"/> </p> </xsl:template>
<xsl:template match="*" mode="x"> <xsl:param name="a" select="@*"/> <xsl:choose> <xsl:when test="exists($a)"> <xsl:element name="{name($a[1])}"> <xsl:apply-templates select="." mode="x"> <xsl:with-param name="a" select="$a[position()!=1]"/> </xsl:apply-templates> </xsl:element> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] flat xml tree to indent one, Matthieu Ricaud-Duss | Thread | Re: [xsl] flat xml tree to indent o, Michael Kay |
[xsl] flat xml tree to indent one, Matthieu Ricaud-Duss | Date | Re: [xsl] flat xml tree to indent o, Michael Kay |
Month |