I need to manipulate a XML string.
The string is this one :
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
I thought I would convert it into a XmlDocument, but XmlDocument.LoadXml()
throws an error about the ":" character ; it's because of the fb:like:layout
attribute.
What I need to do, is add an addthis:url
attribute to the first element with a addthis_toolbox
or addthis_button
class.
I'm pretty confident that I can find the element with the correct class, but I'm not really confident that I can add a "composite" attribute like that... especially since I can't even load the thing to a XmlDocument.
Did I miss something ? Is there a better/simpler way ?
Thanks