开发者

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&amp;autoPlay=true&amp;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 &#61;

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜