James wrote:
> [DOM4J supports DOM ...] In terms of the DOMReader and DOMWriter in
org.dom4j.io to read & write a
> W3C DOM tree to & from a dom4j tree.

OK. Although I tested this yesterday and noticed a little problem with the
import of the internal subset of a document type. I reported the problem on
this mailing list.

James wrote:
> [...] I hope that a java List could be an alternative to
> defining a DocumentFragment in the dom4j API.
>
> A Branch is a polymorphic interface so that Element and Document can
> be used polymorphically as a Branch.
>
> [...] I just wonder how useful DocumentFragment would
> really be to dom4j developers. Java 2 Collections seem a bit easier to
use
> for Java developers.

If I use a List (of Nodes) to represent my document fragment, I cannot
manipulate it through the Branch or Node interface, because java.util.List
does not (and will most certainly never) extend org.dom4j.Node or
org.dom4j.Branch.
That is why I suggested to create a class that would in effect be a list of
Nodes, and that would extend Branch.
I called it DocumentFragment because I thought that this would help people
understand what it represents, and because most DOM4J objects have names
that match those in the DOM. But call it NodeList if you prefer.

Do DOM4J users really need a NodeList/DocumentFragment?

- In my opinion anyone working with external entities (that includes me)
needs this.
- The W3C people seemed to think it would be usefull.
- The fact that the write() method of XMLWriter will 'digest' a list of
Nodes seems to be an indication that other DOM4J users are working with
'List of Nodes'. Would'nt it be more elegant to handle this through the
XMLWriter.read(Branch) method?


Luca

PS. This posting will be the last in my 'plea for a DocumentFragment'
series.
Sorry to have bothered you guys with this.



--
DISCLAIMER:
This e-mail contains proprietary information some or all of which may be
legally privileged. It is for the intended recipient only. If an addressing
or transmission error has misdirected this e-mail, please notify the author
by replying to this e-mail. If you are not the intended recipient you must
not use, disclose, distribute, copy, print, or rely on this e-mail.


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to