...

View Full Version : replacing nodes with XQuery



dudeamisgriff
08-27-2008, 08:53 AM
alright lets say we have example.xml


<users>

<userID>1
<name>Steve</name>
</userID>

<userID>2
<name>Dave</name>
</userID>

<userID>3
<name>Walt</name>
</userID>

<userID>4
<name>Brodie</name>
</userID>

</users>


will this function allow me to change the name node, based on the userID?


function changeName(name){
replace node doc("example.xml")/users/userID[userID]/name
with "<name>" + name + "</name>"
}

Alex Vincent
08-28-2008, 06:25 PM
What language is this?

dudeamisgriff
08-29-2008, 10:56 AM
What language is this?

XQuery



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum