I have an xml file I would like to update everytime there's a change.
I would like to change the start element from time to time.
But I can't get the start node, it's only returning as a String.
Can someone please help me with this.
The code isn't very helpful, because we can't tell what XPath expression you are using. Perhaps the code doesn't produce the expression you think it does.
I see your problem... you think that the toString() method of an Element will convert the Element and all of its children to XML and return that. But it doesn't. It just returns the node value. For the node value of various kinds of nodes see the API documentation for org.w3c.dom.Node; in particular notice what the node value of an Element is.
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
Gift giving made easy with the permaculture playing cards