James wrote:
>FWIW you can pass a List of Nodes into the write() method of XMLWriter.

Nice! I missed that.


James wrote:
> I'm just being devil's advocate here just trying to determine how useful
a
> DocumentFragment would be. It could well be that a DocumentFragment
> interface and default implementation may make sense.

Dane wrote:
> I disagree.  The org.dom4j.Branch interface behaves like a
> org.w3c.DocumentFragment with additional benefits (XPath).  As James has
> pointed out, the org.dom4j.io.XMLWriter class is more than happy to
> write-out a Branch, therefore all of Luca's requirements (as described in
> previous message) can be satisfied with the current dom4j release.

I agree that the DocumentFragment does not add any functionality. Exactly
like in W3C DOM, this interface would be empty.
But this does not mean it is useless. It represents something other that a
Document or a Node.
Also I think it would be a nice addition, especially since DOM4J claims to
offer full support for the standards, such as W3C DOM.
By the way, there is already some support for DocumentFragment in the DOM4J
source code. Have a look at AbstractNode.NODE_TYPE_NAMES for example.

Dane is right, what I need is a class that implements Branch.
Unfortunately there is no createBranch() method in the DocumentFactory,
and I did not find any org.dom4j.tree.DefaultBranch class.

I would suggest adding the DocumentFragment interface to org.dom4j and
implement it using a sub-class of org.dom4j.tree.AbstractBranch.
I am trying this out for the moment. Will let you know if it is
successfull.

Luca



--
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