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:template match="/">
<html>
<a href="www.privacy.com">Read our <b>privacy policy.</b></a>
</html>
</xsl:template>
</xsl:stylesheet>
if applied to any XML document (not used), produces the desired result :
<html><a href="www.privacy.com">Read our <b>privacy policy.</b></a></html>
, and this is displayed by the browser as :
Check out our privacy policy .
Now imagine that nothing is hard-coded in the XSLT stylesheet — instead, the data is in the original XML document :
<link url="www.privacy.com">
Read our <b>privacy policy.</b>
</link>
:
<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="link">
<a href="{@url}"><xsl:apply-templates/></a>
</xsl:template>
</xsl:stylesheet>
XML-, , :
<a href="www.privacy.com">
Read our <b>privacy policy.</b>
</a>