How can I import nodes recursively from one document object to another using Java's J.A.X.P ?

Brian Ewins

You can't. JAXP is an API for getting hold of a document object or a parser. Beyond that, you're into the DOM, SAX or JDOM APIs instead. The easiest approach is to use JDOM, which has FAQ examples on how to reparent an element recursively. JDOM does not have a Node abstraction. Neither does JAXP for that matter, its part of DOM. If you are committed to using the DOM you need a DOM Level-2 capable parser. You need to look up the documentation for importNode() . If it's 'deep' parameter is true it will import recursively.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact