Error occured
System.Xml.XmlException: An error occurred while parsing EntityName. Line 28, position 80.
at System.Xml.XmlTextReaderImpl.Throw(String res, Int32 lineNo, Int32 linePos)
at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.Xsl.Xslt.XsltInput.ReadTextNodes()
at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling()
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList)
at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet()
at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument()
at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
Depending on where the string is used, you may not even need to escape it - but if you have to, you need to escape the ampersands you're using. Yes, it's tricky, but you're doing the equivalent of including a double-quote character in a double-quoted string. The ampersand is special in XML, so you need to escape it:
replace & with &
I have a macro that makes API calls.
The API urls are generated by an outside system. This outside system strings together query params using a single ampersand.
The url is passed as a macro param.
What I want to do is replace the ampersands with
&
I tried this:
But I just get:
I tried to disable the output escaping:
Hi Jacob,
Depending on where the string is used, you may not even need to escape it - but if you have to, you need to escape the ampersands you're using. Yes, it's tricky, but you're doing the equivalent of including a double-quote character in a double-quoted string. The ampersand is special in XML, so you need to escape it:
/Chriztian
It is used in
I did not test it again, but I recall from when I first did the macro that the raw ampersand broke it.
Nevertheless, the replacement you have suggested works. Awesome.
is working on a reply...