|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: RE: Transformation XML to XML
This is just horrible. disable-output-escaping should never be used to
construct markup in the serialized output. And in this case, there's no
possible excuse because the correct code is dead easy:
><xsl:template match="z:row">
><xsl:text disable-output-escaping="no"><image></xsl:text>
><xsl:for-each select="@*">
<xsl:text disable-output-escaping="no"><</xsl:text>
<xsl:value-of select="name()"/>
<xsl:text disable-output-escaping="no">></xsl:text>
> <xsl:value-of select="."/>
> <xsl:text disable-output-escaping="no"></</xsl:text>
> <xsl:value-of select="name()"/>
> <xsl:text disable-output-escaping="no">></xsl:text>
></xsl:for-each>
><xsl:text disable-output-escaping="no"></image></xsl:text>
></xsl:template>
What's wrong with:
<xsl:template match="z:row">
<image>
<xsl:for-each select="@*">
<xsl:element name="{name()}">
<xsl:value-of select="."/>
</xsl:element>
</xsl:for-each>
</image>
</xsl:template>
Michael Kay
http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








