- Code: Select all
Object clonedObj = XmlUtils.deepCopy(paraNodeObj);
I want to modify content of the nodes that are returned from xpath, then eventually add the cloned nodes back to the document that I'm working on.
Is this possible?
Object clonedObj = XmlUtils.deepCopy(paraNodeObj);
desau wrote:I want to run xpath on a node that's been cloned with the XmlUtils.deepCopy method. Is this possible?
Marshaller mar = jc.createMarshaller();
ByteArrayOutputStream bout = new ByteArrayOutputStream(256);
mar.marshal(elem, bout);
Unmarshaller unmar = jc.createUnmarshaller();
elem = unmar.unmarshal(new StreamSource(new ByteArrayInputStream(
bout.toByteArray())), valueClass);
binder = jc.createBinder();
jaxbElement = binder.unmarshal( node );
desau wrote:I want to modify content of the nodes that are returned from xpath, then eventually add the cloned nodes back to the document that I'm working on. Is this possible?
public List<Object> getJAXBNodesViaXPath(String xpathExpr, Object someJaxbElement, boolean refreshXmlFirst)
throws JAXBException {
return XmlUtils.getJAXBNodesViaXPath(binder, someJaxbElement, xpathExpr, refreshXmlFirst);
}
Users browsing this forum: No registered users and 36 guests