<result>
<relatedProducts>
<item>
<id></id>
<name></name>
<text></text>
</item>
<item>
<id></id>
<name></name>
<text></text>
</item>
<item>
<id></id>
<name></name>
<text></text>
</item>
...
</relatedProducts>
<item>
<id></id>
<name></name>
<intro></intro>
<detail></detail>
</item>
<item>
<id></id>
<name></name>
<intro></intro>
<detail></detail>
</item>
...
</result>
This is a simplified XML structure of the xml file I want to use.
There are might be website urls inside the node text, e.g.
<text>...href="something.com/default.aspx?id=3"...</text>
<detail>...href="something.com/default.aspx?id=25"...</detail>
What I want is in C# loop through all the nodes in this xml document and check the URL link, then change the link based on the id in that link. For example,
I use regular expression to check every node value I see this URL meet the pattern
<text>...href="something.com/default.aspx?id=3"...</text>
And I'd like to change it to
<text>...href="somethingelse.com/query.aspx?rid=3"...</text>
At last, return the whole xml document with the right URL.