Copied to clipboard

Flag this post as spam?

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


  • Jannick Læssøe 7 posts 27 karma points
    Nov 11, 2009 @ 12:49
    Jannick Læssøe
    0

    & (ampersand) in tags breaks xslt

    Hi there

    I have been playing with the Blog4Umbraco package that uses the tags datataype.

    I do not know if it is a unhandled bug, but if you create a tag like "H&M" the resulting xml in umbraco.config is:
    <data alias="tags"><![CDATA[H&M]]></data>

    As far as I know, this is not valid XML, and that is why the xslt returns an error.

    Does anybody have experience with this "bug" in tags?

  • Casey Neehouse 1339 posts 483 karma points MVP 2x admin
    Nov 12, 2009 @ 08:58
    Casey Neehouse
    0

    Since the & is in CDATA tags, I am not sure this is your problem. What is the error you are receiving?

  • Jannick Læssøe 7 posts 27 karma points
    Nov 12, 2009 @ 09:26
    Jannick Læssøe
    0

    Maybe you are right :)

    I get this error:
    Error parsing XSLT file: \xslt\BlogListPosts.xslt

    An error occurred while parsing EntityName. Line 2, position 47.
    An error occurred while parsing EntityName. Line 2, position 47.
      at System.Xml.XmlTextReaderImpl.Throw(Exception e)
      at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
      at System.Xml.XmlTextReaderImpl.ParseEntityName()
      at System.Xml.XmlTextReaderImpl.ParseEntityReference()
      at System.Xml.XmlTextReaderImpl.Read()
      at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
      at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
      at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
      at System.Xml.XmlDocument.Load(XmlReader reader)
      at System.Xml.XmlDocument.LoadXml(String xml)
      at umbraco.editorControls.tags.library.getTagsFromNode(String nodeId)

    An error occurred while parsing EntityName. Line 5, position 47.
    An error occurred while parsing EntityName. Line 5, position 47.
      at System.Xml.XmlTextReaderImpl.Throw(Exception e)
      at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
      at System.Xml.XmlTextReaderImpl.ParseEntityName()
      at System.Xml.XmlTextReaderImpl.ParseEntityReference()
      at System.Xml.XmlTextReaderImpl.Read()
      at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
      at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
      at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
      at System.Xml.XmlDocument.Load(XmlReader reader)
      at System.Xml.XmlDocument.LoadXml(String xml)
      at umbraco.editorControls.tags.library.getAllTagsInGroup(String group)

    Actually, it seems more likely that the "bug" is in the to methods in umbraco.editorControls.tags.library?

    The XSLT calls both of these methods, and the error only appear if I have used a tag with ampersand in one of the blogposts...

  • Bram Loquet 72 posts 102 karma points
    Jul 05, 2010 @ 17:21
    Bram Loquet
    0

    the error occurs at umbraco.editorControls.tags.library.getTagsFromNode(String nodeId) and at umbraco.editorControls.tags.library.getAllTagsInGroup(String group) so it seems to me at this is indeed a bug.

    I made a workitem for this http://umbraco.codeplex.com/workitem/27650 so please vote.

  • Dan Evans 629 posts 1016 karma points
    Aug 26, 2011 @ 19:51
    Dan Evans
    0

    Am i correct in thinking that as the tags datatype is part of the core fixing this would involve amending the core source code? Really don't want to do this but can't see a work around. I was considering a SQL Server trigger?

    Has anyone else found a work around? Whenever anyone enters & in a tag the site breaks.

    I can't see any event handlers for tags.

  • Thijs 97 posts 117 karma points
    Oct 20, 2011 @ 14:27
    Thijs
    0

    I'm having the same problem, how did you fixed it?

    Thijs

  • Kris Dyson 54 posts 79 karma points
    Mar 10, 2013 @ 18:41
    Kris Dyson
    0

    I'm having the same problem in Umbraco 6.0.2.  Blog4Umbraco breaks when the user puts in a tag with an ampersand (&).  This either needs XML encoding on the way into the database or encoding properly by the getAllTags function in umbraco.editorControls.dll

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Mar 10, 2013 @ 19:56
    Jan Skovgaard
    0

    Hi Kris

    Could you try and post the code snippet that is rendering your content?

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft