Skip to main content

In Java how can you convert a String that represents a fragment of XML for insertion into an XML document?

e.g.

String newNode =  "<node>value</node>"; // Convert this to XML

Then insert this node into an org.w3c.dom.Document atorg.w3c.dom.Document as the child of a given node?

In Java how can you convert a String that represents a fragment of XML for insertion into an XML document?

e.g.

String newNode =  "<node>value</node>"; // Convert this to XML

Then insert this node into an org.w3c.dom.Document at as the child of a given node?

In Java how can you convert a String that represents a fragment of XML for insertion into an XML document?

e.g.

String newNode =  "<node>value</node>"; // Convert this to XML

Then insert this node into an org.w3c.dom.Document as the child of a given node?

edited title
Link
Fortyrunner
  • 12.8k
  • 4
  • 35
  • 54

Covert Convert String XML fragment to Document Node in Java

Source Link
James Wardle
James Wardle

Covert String XML fragment to Document Node in Java

In Java how can you convert a String that represents a fragment of XML for insertion into an XML document?

e.g.

String newNode =  "<node>value</node>"; // Convert this to XML

Then insert this node into an org.w3c.dom.Document at as the child of a given node?