Copied to clipboard

Flag this post as spam?

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


  • Frederik T 241 posts 372 karma points
    Aug 11, 2011 @ 13:09
    Frederik T
    0

    Render HTML from text

    I will try and explain this as good as i can, the website im working on, the documents (or rather, written articles) recieves its raw text from an XML file recieved from a web service.

    In that text, is HTML tags for formatting, but as it is now, the tags are just displayed as ordinary text and not read as actual HTML. The text IS shown though, but of course it lacks formatting.

    Im forced to recieve the text this way, as the old companies website worked this way, and it cant be changed. (I suggested removing the html from the text from the server itself, and that was met with a big no so...)

    Anyway, i tried using the StripHTML, which removes all the HTML tags, and that worked fine, but that makes the formatting even worse.

    So now i want to know if there is a smiliar function, that makes it render the HTML instead of removing or ignoring it.

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 11, 2011 @ 13:32
    Lee Kelleher
    1

    Hi Frederik,

    Do you have an example of the text (with HTML in it)?

    Thinking that you might just need to escape the output encoding, like so...

    <xsl:value-of select="text" disable-output-escaping="yes"/>

    Cheers, Lee.

  • Frederik T 241 posts 372 karma points
    Aug 11, 2011 @ 13:43
    Frederik T
    0

    Oh how stupid of me, i glanced over that function but shrugged it off. But thank you very much, it works like a charm :)

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 11, 2011 @ 13:44
    Lee Kelleher
    0

    Hi Frederik, no worries - glad that you've got it sorted.

    Cheers, Lee.

  • Cristian 24 posts 45 karma points
    Nov 01, 2011 @ 19:09
    Cristian
    0

    excelent!!!! thats what i looking for

Please Sign in or register to post replies

Write your reply to:

Draft