On Thu, 26 Jul 2001, Gavin Stokes wrote:

> >Another is that your DOM implementation may be creating specially
> >subclassed DOM nodes based on the name of the node.  These subclassed
> >nodes may be used for data binding, or special application purposes.  If
> >you change the name of the node, what happens to the class of the node?
> 
> This is very similar to (but sort of opposite to) my situation.  I'm 
> creating nodes to store Java (or C++) objects as XML.  If you're doing 
> this, and you're converting subclassed objects into XML, it stands to 
> reason that you'd have one routine to write the base-class data members, 
> and another routine to add extra members of the subclass, and so on down 
> the class hierarchy.

Maybe you'd be better off using a different object model.  Have you looked
at JDOM (http://www.jdom.org)?  JDOM nodes can be freely renamed, and
manipulated in rather more friendly ways than W3C DOM nodes.  JDOM has its
own serializer to convert the JDOM tree to XML, or alternatively, you can
build a W3C DOM tree from the JDOM one if that suits your purposes better.

Ian

-- 
Ian Roberts, Software Engineer        DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to