
Untitled
By: a guest on
Aug 5th, 2012 | syntax:
None | size: 0.51 KB | hits: 11 | expires: Never
best way to replace placeholder with value in xml string
<PlaceHolders>
<PlaceHolder placeholder="PD1" value="value1" />
</PlaceHolders>
<customers>
<customer avatarURL="PD1"/>
</customers>
Dim doc As New XmlDocument()
doc.LoadXml("...")
For Each node As XmlNode In doc.SelectNodes("//@*[.='PD1']")
node.InnerText = "value1"
Next
Dim doc As New XmlDocument()
doc.LoadXml("...")
For Each node As XmlNode In doc.SelectNodes("//@*[.='PD1'] | //*[text()='PD1']")
node.InnerText = "value1"
Next