469,343 Members | 5,694 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

modify xml node

Hi,

Let's say I have a table with xml column.
I would like to update this xml as following:
my xml looks like this:

Expand|Select|Wrap|Line Numbers
  1. <ArrayOfValueHolder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  2.   <ValueHolder>
  3.     <Value>3.00</Value>
  4.     <IsNoteDirty>false</IsNoteDirty>
  5.     <Timestamp>
  6.       <StampType>Month</StampType>
  7.       <Stamp>3</Stamp>
  8.       <Year>2007</Year>
  9.     </Timestamp>
  10.   </ValueHolder>
  11.   <ValueHolder>
  12.     <Value xsi:nil="true" />
  13.     <IsNoteDirty>false</IsNoteDirty>
  14.     <Timestamp>
  15.       <StampType>Month</StampType>
  16.       <Stamp>4</Stamp>
  17.       <Year>2007</Year>
  18.     </Timestamp>
  19.   </ValueHolder>
  20.   <ValueHolder>
  21.     <Value>2.00</Value>
  22.     <IsNoteDirty>false</IsNoteDirty>
  23.     <Timestamp>
  24.       <StampType>Month</StampType>
  25.       <Stamp>5</Stamp>
  26.       <Year>2007</Year>
  27.     </Timestamp>
  28.   </ValueHolder>
  29.   <ValueHolder>
  30.     <Value>5.00</Value>
  31.     <IsNoteDirty>false</IsNoteDirty>
  32.     <Timestamp>
  33.       <StampType>Month</StampType>
  34.       <Stamp>6</Stamp>
  35.       <Year>2007</Year>
  36.     </Timestamp>
  37.   </ValueHolder>
  38. </ArrayOfValueHolder>
I want to modify the "value" node but only where: Year = 2007 and Stamp = 6 and I don't know what's the number of this node so i can't write:
xml.modify(replace value of (.//Value/text())[4] .... ) for example
how can i do it?
Apr 22 '07 #1
1 1801
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN...

What language are you using?
Please post your current code, to test it here.

Thanks,
Dorin.
Apr 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by mike | last post: by
3 posts views Thread by Maileen | last post: by
1 post views Thread by shukyh | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.