Trying to load some XML into a document:
<Custom AttributeA='' AttributeB='Bob' AttributeC='HUNTERS' COMPANY EMPLOYEES' 403B PLAN' />
Then when I try to add it to a document:
XmlDocument xmlCustom = new XmlDocument();
xmlCustom.LoadXml(customNode);
I end up getting an error message System.Xml.XmlException: ‘COMPANY’ is an unexpected token. The expected token is ‘=’.
The value of AttributeC is supposed to be: HUNTERS’ COMPANY EMPLOYEES’ 403B PLAN
I tried replacing the ‘ previously before loading the XML but it replaces ALL of the apostrophe’s and AttributeA='' is equally invalid.
EDIT: Yes, I would agree on poorly formed but it is what I have to work with.
You can use
or
or even