Subject: [xsl] XML/XHTML fragment to text From: Alain <alainb06@xxxxxxx> Date: Thu, 09 Aug 2007 22:44:07 +0200 |
<!-- XML to text templates --> <xsl:template match="fragment//element()"> <xsl:choose> <!-- for not empty elements --> <xsl:when test="*|text()"> <xsl:text><</xsl:text> <xsl:value-of select="name(.)"/> <xsl:apply-templates select="@*"/> <xsl:text>></xsl:text> <xsl:apply-templates select="*|text()"/> <xsl:text></</xsl:text> <xsl:value-of select="name(.)"/> <xsl:text>></xsl:text> </xsl:when> <!-- for empty elements --> <xsl:otherwise> <xsl:text><</xsl:text> <xsl:value-of select="name(.)"/> <xsl:apply-templates select="@*"/> <xsl:text>/></xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template>
<xsl:template match="fragment//text()"> <xsl:value-of select="."/> </xsl:template>
<xsl:template match="fragment//@*"> <xsl:text> </xsl:text> <xsl:value-of select="name(.)"/> <xsl:text>="</xsl:text> <xsl:value-of select="."/> <xsl:text>"</xsl:text> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Efficiency: predicate vs , Michael Kay | Thread | Re: [xsl] XML/XHTML fragment to tex, christoph . naber |
RE: [xsl] Efficiency: predicate vs , Michael Kay | Date | [xsl] XSLT merge documents into var, Lars Kappert |
Month |