Reputation: 441
For example, the following xml works if there is no special characters in the value. But fails when I have & sign. I tried to wrap the value with CDATA syntax (<![CDATA[CITY & COUNTY]]>
) but getting "Unexpected end of file while parsing CDATA has occurred. Line 44, position 122"
<Method ID="5">
<Field Type="Text" Name="Company" DisplayName="Company Name" FromBaseType="TRUE" >
<Default>Rob & Schnider Company</Default>
</Field>
</Method>
Additional Info (if needed): I am using SharePoint 2010 and it's web services to set default values for certain columns in a document library.
Upvotes: 0
Views: 2615
Reputation: 441
Actually, since I am using Nintex for workflow there is function which takes care of the special characters. All you do is wrap the value with the the function.
fn-XmlEncode
Encodes a string to make it safe for viewing in html.
Example
fn-XmlEncode({WorkflowVariable:Text})
Upvotes: 1
Reputation: 31184
There aren't very many. there are like 5 characters that you have to escape in your xml.
& & Ampersand sign
' ' Single quote
" " Double quote
> > Greater than
< < Less than
just change your &
to a &
, and it should work.
if you're parsing this with a c# XML library, it should know what to do with the escape sequences.
http://www.rtslink.com/introductionxmlsoap.html
Upvotes: 1