Copied to clipboard

Flag this post as spam?

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


  • Thijs 97 posts 117 karma points
    Oct 21, 2011 @ 09:59
    Thijs
    0

    Blog4Umbraco ampersand

     

    Hi all

    I'm breaking my head over this one so if anyone could help me with this, that would be awesome.

    I'm using the Blog4Umbraco package. When a user tags a blogpost with an ampersand (for example: Tips & Tricks), the BlogListPost.xslt and the BlogCategories.xslt breaks. There are more posts on this forum about this topic but none of them are answered.

    Any help would be appreciated!

     

    Thijs

     

    Here's the error I'm getting:

    umbracoMacro InnerException An error occurred during a call to extension function 'getTagsFromNode'. See InnerException for a complete description of the error. An error occurred during a call to extension function 'getTagsFromNode'. See InnerException for a complete description of the error. at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces, IList`1 post) in C:\websites\thijs.dev\xslt\BlogListPosts.xslt:line 174 at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\websites\thijs.dev\xslt\BlogListPosts.xslt:line 100 at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double ) at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements) umbracoMacro InnerException An error occurred while parsing EntityName. Line 3, position 48. An error occurred while parsing EntityName. Line 3, position 48. 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.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at umbraco.editorControls.tags.library.getTagsFromNode(String nodeId)

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 22, 2011 @ 17:10
    Jan Skovgaard
    0

    Hi Thijs

    How do you fetch the blogposts in XSLT? You should probably do a replace on "&" so that it gets replaced with "&" I could imgine...

    /Jan

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Oct 22, 2011 @ 23:07
    Chriztian Steinmeier
    0

    Hi Thijs,

    This is definitely a bug (and sadly, a very common bug when dealing with XML). An ampersand has special meaning in XML (and HTML for that matter - XML just has more draconian error handling) and it *must* be escaped whenever it's used in a plain text meaning. The input control should handle this. 

    If the tagging mechanism is part of Blog4Umbraco you should report the error to that project, otherwise if it's internal to Umbraco (i.e., does it happen using the "standard" tagging datatype?), it should of course be reported there.

    You can, as Jan suggests, probably work around it, but "fixing the wrong problem" is not really the best solution...

    /Chriztian

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

    Thanks both of you. It's in the tagging of umbraco self. I'm trying to validate the tags with a regex but for some reason it doesn't validate. Thanks anyway for your input!

     

    Thijs

Please Sign in or register to post replies

Write your reply to:

Draft