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)
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...
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!
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)
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
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
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
is working on a reply...