I was trying to find out why is that when a value is not find the result is a new duplicated branch with new value included wich is wrong.

Here it says here
Quote:


The selectSingleNode method returns a Node object for the first descendant node to match the specified pattern. The one parameter of this method is an XSL pattern query. If no match is made, it returns null. This method is similar to the selectNodes method, but returns only the first node to match the pattern rather than all of them.




So when the there is no match the uds shoudnt do any save, instead should advice about the erro.

Another things to take into account:
- If the file does not exist and you use the write udf, the written file format is all flat (no tab nor enter between tags). I dont know if all interpreters white XML files in flat way or ppl accomadate them by hand.
- If the file is hand formatted after any modification the result are tags separted by tab.



BTW. About the new branch in case is does not exist I have found you can point out where that new branch can be placed, like this
$Elem = $xml.documentElement.firstchild.lastchild
I have dicovered this using $Elem.setAttribute(NAME,VALUE)

-----------------------------------------------------------
Oh I seen now, you have to split the path and see if all tags are present so as to create what is missing after the las known tag.
_________________________
Life is fine.