, :
<node><br></node>
XML- XSLT 1.0.
:
<node><br/></node>
<br/> "as-is" - .
:
This conversion is :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="nodes">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="node">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
</xsl:stylesheet>
when applied to this XML document :
<nodes>
<node>
1 <br/>
2 <br/>
3 <br/>
</node>
</nodes>
produces
<html>
<p>
1 <br>
2 <br>
3 <br></p>
</html>
, and this is displayed by the browser as :
1
2
3
source
share