Quantcast
Channel: CRM Development Forum
Viewing all articles
Browse latest Browse all 888

Decode XML data coming from entity record in plug-in for "" characters

$
0
0

I've a plug-in that reads data from one of the entity record. Data is in XML format. When I read the data using CRM web service call, it is returning the XML tags ("<" and ">" characters) with "&lt;" and "&gt;" respectively. Because of this I'm not able to DE serialize the XML into object. Moreover the issue is only on TEST server where base language for CRM is "Spanish". But while on DEV server base language is ENGLISH and we've Spanish language pack is installed on top it. I'm not sure it really makes difference if we have different configuration on DEV and TEST servers with respect to language pack. Just wanted to share with the discrepancies in server configuration.

Error I'm getting is .. "There is an error in XML document (1, 2)"

Input XML: <Rules><Rule><Attributes><Attribute><Name>AttributeName</Name><Type>string</Type></Attribute><Attribute><Name>AttributeName2</Name><Type>GUID</Type></Attribute></Attributes><Message>Custom Message.</Message></Rule></Rules>

Output XML:
&lt;Rules&gt;&lt;Rule&gt;&lt;Attributes&gt;&lt;Attribute&gt;&lt;Name&gt;AttributeName&lt;/Name&gt;&lt;Type&gt;string&lt;/Type&gt;&lt;/Attribute&gt;&lt;Attribute&gt;&lt;Name&gt;AttributeName2&lt;/Name&gt;&lt;Type&gt;GUID&lt;/Type&gt;&lt;/Attribute&gt;&lt;/Attributes&gt;&lt;Message&gt;Custom Message.&lt;/Message&gt;&lt;/Rule&gt;&lt;/Rules&gt;

Is there anyway I can decode/replace &lt; AND &gt; strings to "<" and ">" characters? I already have tries .Replace function which doesn't work.


Viewing all articles
Browse latest Browse all 888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>