Embedding XSL Stylesheet into XML
Posted
by
user700996
on Stack Overflow
See other posts from Stack Overflow
or by user700996
Published on 2012-03-19T00:40:02Z
Indexed on
2012/03/19
2:04 UTC
Read the original article
Hit count: 247
I have the following XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="http://www.fakedomain.com/sally.xsl"?>
And the following content in sally.xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="documentcollection/document">
<p>
<xsl:for-each select="rss/channel/item">
<xsl:value-of select="title"/><br />
<xsl:value-of select="description"/><br />
<xsl:value-of select="link"/><br />
</xsl:for-each>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
However, the browser displays the XML as though the XSL line is not present. Do you know why the browser is ignoring the XSL stylesheet? Is the style sheet wrong?
Thanks
© Stack Overflow or respective owner