Umbraco xslt output html tag which does not validate.
Hi all,
I am using umbraco 4.0.3 with the blog module, and I find that the output html does not validate.
My issue is that the xslt have strip the space out of <br /> and <img /> etc. to make them <br> and <img>, I have tried to use <br></br>, but no luck.
tried to use <xsl:value-of select="<br />" disable-output-escaping="yes" />, no luck
tried to use <xsl:preserve-space elements="*"/> but the umbraco system do not let me do so....
Anyone have any suggestion? idea?
Btw, the xslt output method is 'html' which is from the blog package, I have tried to change it to 'xml' which breaks some other things, and not help solve the issue. Will try indent="yes" to see if any luck... (this will breaks some other stuff, however which is fixable...)
However - this might not be the best solution since it creates <input> <br> and <img> tags without closing /.
--------------------------
which is what i try to solve, currently, I cannot change it to xml as it breaks some content (not sure why), Is there a way to use html and stop it from delete the ending forward slash '/' ?
Umbraco xslt output html tag which does not validate.
Hi all,
I am using umbraco 4.0.3 with the blog module, and I find that the output html does not validate.
My issue is that the xslt have strip the space out of <br /> and <img /> etc. to make them <br> and <img>, I have tried to use <br></br>, but no luck.
tried to use <xsl:value-of select="<br />" disable-output-escaping="yes" />, no luck
tried to use <xsl:preserve-space elements="*"/> but the umbraco system do not let me do so....
Anyone have any suggestion? idea?
Btw, the xslt output method is 'html' which is from the blog package, I have tried to change it to 'xml' which breaks some other things, and not help solve the issue. Will try indent="yes" to see if any luck... (this will breaks some other stuff, however which is fixable...)
Many thanks
dch,
Please refer to http://our.umbraco.org/wiki/how-tos/xslt-useful-tips-and-snippets/stop-html-tags-from-self-closing
Regards
Ismail
Hi Ismail,
Thank you for your link, from the bottom of your link, has pointed out my issue:
--------------------------
Another approach is to change the output to html
<xsl:output method="html" omit-xml-declaration="yes"/>
However -
this might not be the best solution since it creates <input>
<br> and <img> tags without closing /.
--------------------------
which is what i try to solve, currently, I cannot change it to xml as it breaks some content (not sure why), Is there a way to use html and stop it from delete the ending forward slash '/' ?
You could use a html5 doctype making your br etc tags valid once more...
<!DOCTYPE html>
Hi all,
I finally choose to output <xml> and use the xsl:text trick when needed, it gives me more control over the output,
xslt is powerful, but not that straight forward.
is working on a reply...