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
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
Please post a sample Xml document and the final result.
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>
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>
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>
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I, men traveling and havet limiterad access tog internet. Will check next week