Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DCH 18 posts 38 karma points
    Jul 05, 2010 @ 17:50
    DCH
    0

    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="&lt;br&nbsp;/&gt;"  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

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 05, 2010 @ 18:01
  • DCH 18 posts 38 karma points
    Jul 05, 2010 @ 18:06
    DCH
    0

     

    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 '/' ?

  • dandrayne 1138 posts 2262 karma points
    Jul 05, 2010 @ 18:25
    dandrayne
    0

    You could use a html5 doctype making your br etc tags valid once more...

    <!DOCTYPE html>
  • DCH 18 posts 38 karma points
    Aug 23, 2010 @ 14:20
    DCH
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft