hiya,
I previously obtained code that enabled me the replace a node and its
innerText.The code relied on the node that was to be replaced having
?childNodes?
However, it seems that the nodes that were empty are NOT overwritten.
So, the code is as follows:
<code>
Do While (oldElement.Has ChildNodes)
Dim newElement As XmlElement =xmldoc.CreateE lement(newEleme ntText)
newElement.Appe ndChild(oldElem ent.FirstChild)
oldElement.Pare ntNode.ReplaceC hild(newElement , oldElement)
Loop
</code>
Ideally, if the oldElement has no children, I?d like to:
1) overwrite the oldNode with the newNode, regardless.
2) insert a DEFAULT value to the innerText of the the replacing node.
Eg,
if the OLD empty node was:
<oldValue></oldValue>
Then I?d like the new node to be:
<newValue>UNDEF INED</newValue>
As I said, when the oldElement conatains children, then the code works fine.
Does this make sense?
Please let me know if I can clarify anything.
many thanks,
yogi
--
Message posted via http://www.dotnetmonster.com