EDN Admin
Well-known member
This isnt a question directly dealing with serialization but it is the closest that I could find dealing with XML.
I have an XML document that may have an attribute with straight characters and may have those same characters surrounded by { and }. So I came up with the XPath that handles this as:
doc.SelectSingleNode(string.Format("/a/b[@c = {0} or @c={{{0}}}]", "test");
The problem is that the XML processing throws an exception indicating that {test} is invalid. How do I escape the { and } for XPath processing?
Thank you for your suggestions.
<hr class="sig Kevin Burton
View the full article
I have an XML document that may have an attribute with straight characters and may have those same characters surrounded by { and }. So I came up with the XPath that handles this as:
doc.SelectSingleNode(string.Format("/a/b[@c = {0} or @c={{{0}}}]", "test");
The problem is that the XML processing throws an exception indicating that {test} is invalid. How do I escape the { and } for XPath processing?
Thank you for your suggestions.
<hr class="sig Kevin Burton
View the full article