Ask a Question related to ASP.NET General, Design and Development.
-
Bob Yuan #1
XslTransform.transform does not generate xhtml
Hi, I am working on a asp.net project that takes a xml
source and use XslTransform.transform to generate a xhtml
output.
The problem with using XslTransform is that it
automatically reformats the output as HTML instead of
xhtml. For example, if the xslt file contains <img
src="..." />, the result html file is <img src="..." > and
this is not well formed xhtml.
Is there a way to prevent this aut-reformatting from
happening? I have been testing with the simplest examples:
say the xslt is:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html><body>image<img src="#" /></body></html>
</xsl:template>
</xsl:stylesheet>
The resulting html is:
<html>
<body>image<img src="#"></body>
</html>
It is perfectly fine xml, but not xhtml since the "/" is
removed.
However, if I remove "<html><body>" etc from the xslt file:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
image<img src="#" />
</xsl:template>
</xsl:stylesheet>
I do get what I want:
<?xml version="1.0" encoding="utf-8"?>
image<img src="#" />
So, something is reformatting the html output when there
is <html> tag existing. How to turn it off?
Thanks.
Bob Yuan Guest
-
XHTML and XSTL
HI, I am working on a document management system. The system gives output in xhtml format. I am using Flex as the presentation tier, I wanted to... -
XHTML
Should I convert my doc to XHML? I am getting rather confused. I done it to a doc and then tested it at w3c and had a ton of errors, I had less... -
cfgraph and XHTML
Hello all, I have an XHTML 1 Strict page that includes a cfgraph Flash graphic. I've seen that the HTML code generated is not XHTML: tags are in... -
html > Xhtml
Hi, I'm tryin to delete all open <p> tags from the body text of news articles on my site. Im doing this, by : <cfset cleanBody =... -
XHTML / CSS
First, excuse-me for this out of topic message. I am searching a good mailling-list for people trying to write standard XHTML and CSS. ... -
Michal A. Valasek #2
Re: XslTransform.transform does not generate xhtml
| So, something is reformatting the html output when there
| is <html> tag existing. How to turn it off?
<xsl:output method="xml" />
if you don't specify output method, it would guess. And if you have <html>
there, sets <xsl:output method="html" />
-- Altair
Michal A. Valasek Guest



Reply With Quote

