D
Derek Fountain
Just asked a question regarding this little bit of XSL:
---
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html"/>
<xsl:template match="/">
<xsl:text>' < > " &</xsl:text>
</xsl:template>
</xsl:stylesheet>
---
When run I get:
i.e. the < etc. aren't being converted to <, etc., (although the '
does).
Someone told me to change the method="html" to method="text" and that indeed
fixed the problem. My question now, is, why?
My required final output is actually HTML (not XHTML, it's going into a
legacy application which I can't re-engineer) so I need to be able to put
out things like unclosed <p>'s and the like. If I put them directly in my
XSL I get errors saying it's not a well formed document - which of course
it isn't. If I use <p> then they don't get converted unless I use an
output method of "text".
Can someone help me understand what's happening here - either with an
explanation or a URL I can read?
---
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html"/>
<xsl:template match="/">
<xsl:text>' < > " &</xsl:text>
</xsl:template>
</xsl:stylesheet>
---
When run I get:
' < > " &xsltproc test1.xsl test1.xml
i.e. the < etc. aren't being converted to <, etc., (although the '
does).
Someone told me to change the method="html" to method="text" and that indeed
fixed the problem. My question now, is, why?
My required final output is actually HTML (not XHTML, it's going into a
legacy application which I can't re-engineer) so I need to be able to put
out things like unclosed <p>'s and the like. If I put them directly in my
XSL I get errors saying it's not a well formed document - which of course
it isn't. If I use <p> then they don't get converted unless I use an
output method of "text".
Can someone help me understand what's happening here - either with an
explanation or a URL I can read?