mikesowerbutts 0 Newbie Poster

Hi All,

Am given a string:
%3CNodeName%20att1%3D'%3F'%3C%3E'%3E%40innertext%3B%3A%3C%3E%3C%2FNodeName%3E

this is a UrlEncoded version of:
<NodeName att1='?'<>'>@innertext;:<></NodeName>

if i UrlDecode the entire string there is some invalid characters in the nodes attribute and the nodes innerText property. I have a function to search for the innertexts and encode them which seems to work ok. But I am having serious problems doing the same for the attributes. I cant guarantee if the attribute values will be encased with "value" always, sometimes they're 'value'.

If i try to do:

MyXmlDoc.LoadXml("<NodeName att1='?'<>'>@innertext;:<></NodeName>");

It errors becuase of the special characters in the InnerText/Attribute values. So if I could also UrlEncode the attribute values that would fix this problem!

I have searched around on Google for a good few hours on this issue now and so far havn't found anything on the matter - I dont have control on the xml that is sent to me, so I cant do the work at that end when the xml string is constructed unfortunately.

Thanks,

Mike