From: <[EMAIL PROTECTED]>
> Just like to point out that the DOM4J list of features, on the DOM4J home
> page, includes this item:
>
>    *   full support for JAXP, TrAX, SAX, DOM and XSLT.
>
> The DOM in this list is a hyper-link to the W3C DOM specification.
>
> I guess the question comes down to what 'full support' really means...

In terms of the DOMReader and DOMWriter in org.dom4j.io to read & write a
W3C DOM tree to & from a dom4j tree.


> Let me point out also that the class org.dom4j.dom.DOMDocument includes
the
> following method:
>
> public org.w3c.dom.DocumentFragment createDocumentFragment() {
>    DOMNodeHelper.notSupported();
>    return null;
> }
>
> And here is the code for DOMDocumentHelper.notSupported() :
>
> /** Called when a method has not been implemented yet
>  */
> public static void notSupported() {
>    throw new DOMException( DOMException.NOT_SUPPORTED_ERR, "Not supported
> yet");
> }
>
> I guess that at some point in the past there was an intention to support
> DocumentFragments...

The org.dom4j.dom package is an attempt to provide some dual-tree support.
That is to say that a dom4j user could use the dom4j API to create or
manipulate a document and if they wished to, could use the
DOMDocumentFactory to create a dom4j tree which is capable of being cast to
its w3c DOM equivalent.

> I agree that the DOM is a good idea that went wrong, and that the
designers
> of DOM4J have done a much better job.
> This is why I have decided to switch to DOM4J on a project that was
> initially started using W3C DOM.
> Nevertheless W3C DOM deserves some credit for laying out good concepts,
and
> among those the DocumentFragment.

Agreed. Though w3c DOM is defined in IDL and so cannot take advantage of
Java 2 Collections. I hope that a java List could be an alternative to
defining a DocumentFragment in the dom4j API.


> The DOM4J concept of Branch is very similar. But why is it not possible to
> instanciate a Branch?

A Branch is a polymorphic interface so that Element and Document can be used
polymorphically as a Branch.

> Would'nt  DocumentFragment be a perfect candidate to be a concrete
> sub-class of Branch?

I guess its possible yes. I just wonder how useful DocumentFragment would
really be to dom4j developers. Java 2 Collections seem a bit easier to use
for Java developers.

James



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to