Using VTD-XML to modify element text only
Posted
by Algorist
on Stack Overflow
See other posts from Stack Overflow
or by Algorist
Published on 2010-05-05T13:44:25Z
Indexed on
2010/05/05
13:48 UTC
Read the original article
Hit count: 886
Hi,
I want to achieve below thing in vtd-xml xml modifier class.
Original xml
<xml>
<element attr1='1' attr2='2' attr3='3'>text</element>
</xml>
int p = vn.getText()
xm.updateToken(p, "new text");
But the code here is not modifying the text to new text. Any idea how to achieve this?
Other option is to call xm.remove() and then add tag. But, I am not able to retain the attributes.
Thank you
Bala
© Stack Overflow or respective owner