How can i handle Special characters( =) in XML
I have some special characters in my data inside xml.So i am getting error to handle them.
<SubFilePath>http://d2coa5o205622p.cloudfront.net/newswatchforweb&autoPlay=true&auto开发者_StackOverflow中文版Rewind=false</SubFilePath>
"'=' is an unexpected token. The expected token is '";
I know how to handle other special like "<",">" ,"\"" ,"\'" ,"&" but how can i handle the "="?
I am using c#
Wrap your data inside a CDATA block.
Or use =
see: http://www.theukwebdesigncompany.com/articles/entity-escape-characters.php
If you use one of the XML APIs to write your XML, then there will not be a problem. Use XmlWriter or XElement.
If you have an associated XSL schema, then you should also define this element with the type "anyURI", like this :
<xs:element name = "SubFilePath" type = "xs:anyURI" />
See this book
精彩评论