Hi Mike

> It would be nice to have mechanisms to set the innerXML and outerXML, in a
> similar mechanism to the innerHTML and outer HTML properties in the HTML
> DOM.

I'm not aware of the innerHTML outerHTML properties in the HTML DOM. Any
pointers?

> The mechanism should by default use the same DocumentFactory as one that
the
> node was created with
> It should also be able to cope with setting any node type. (This would be
> very useful for the edit panels in visdom)
>
> Ideally (as a default option?) it should have the ability to modify the
> current node rather to replace it, and potentially (not default) merge the
> values into the existing document. We should ensure that
>
> Node node = document.getRootElement();
> node.setOuterXML("fred");
>
> //document.getRootElement() == node

I'm guessing, as I'm not sure what setOuterXML() should do. Is it a way of
wrapping a Node with an element tag?

If so you could do this like...

Element oldRoot = document.getRootElement();
oldRoot.detach();
Element newRoot = document.addElement( "fred" );
newRoot.add( oldRoot );

A similar approach could be taken at the Element level too using
combinations of detach(), addElement() and add( oldElement );

James


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


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

Reply via email to