Link to home
Start Free TrialLog in
Avatar of pucko73
pucko73

asked on

Find nodes and change values in a xml (mssql)

Hello.

Can someone help me with one thing.

I need help with
1. Create a store procedure that finds
all nodes with name "XXX" in a xml document and set
the value YYY in those nodes.

2. I need to create a sp that finds all nodes with a VALUE YYY
and replace that with a new value ZZZ
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Please post a sample Xml document and the final result.
Avatar of pucko73
pucko73

ASKER

I don't want it to be specific to the xml. I want it to find every node in the xml that has a specific value

for example
<root>
<test1>@r1</test1>
<a>
<test1>@r1</test1>
</a>

</root>

i now want to replace all @r1
with XXX for example.


<root>
<test1>XXX</test1>
<a>
<test1>XXX</test1>
 
</a>

</root>
Avatar of pucko73

ASKER

Sorry that was for nr 2

for nr 1


<root>
<test1>x1</test1>
<a>
<test1>x2</test1>
</a>
</root>
Here I want to specify that I want to replace values in nodes with name test1 with value YYY
and get



<root>
<test1>YYY</test1>
<a>
<test1>YYY</test1>
</a>
</root>
ASKER CERTIFIED SOLUTION
Avatar of keyu
keyu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pucko73

ASKER

I, men traveling and havet limiterad access tog internet.  Will check next week