Copied to clipboard

Flag this post as spam?

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


  • John Hård 9 posts 29 karma points
    Dec 01, 2009 @ 21:19
    John Hård
    0

    getTagsFromNode fails on ampersand

    Hello Forum.

    I am using the BlogForUmbraco4 package (v 1.0) and came across a problem with the macro listing the tags next to the blog. The xslt file BlogCategories.xslt makes a call to the API method umbraco.editorControls.tags.getTagsFromNode, and it all works well until I enter a tag with an ampersand (&) in it. 
    I had a closer look at the code of the getTagsFromNode method and what it does is this:

    1. Fetch the tags from the database
    2. Build an xml document in the shape of a string
    3. Create an XmlDocument from the string

    Now, if a tag contains an ampersand, a call to doc.LoadXml(xmlVal) which is done in that method fails due to poorly formatted xml. The only ways I can think of to avoid this problem are these:

    1. Tell the users that they have to enter & instead of & in the tags.
    2. Compile my own version of umbraco.editorConstrols where I html-format the tags before calling doc.LoadXml()

    My question now: Is there any other way? I am not very good with xslt so maybe I am missing something obvious, but since the error occurs in the API and not in the xslt I don't think any xslt magic will help me.

    Any input would be greatly appreciated. Thank you!

    (I am using Umbraco 4.0.2.1)

    /John Hård
    Stockholm

  • Thijs 97 posts 117 karma points
    Oct 20, 2011 @ 15:24
    Thijs
    0

    Hi John

    I'm having the same problem. I know it's a long time ago but do you remember how you fixed that issue?

      

    Thijs

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies