axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venkat Reddy <vred...@gmail.com>
Subject Re: [Axis2] OMNodeImpl notes
Date Fri, 15 Apr 2005 10:41:16 GMT
Before i talk about the problem, Eran, i see that we are still
creating the OMDocument and setting the first ELEMENT_NODE as its
rootElement. - isn't it?

The problem as i understood:

There are stuff other than root element (envelop) that need go as
children into the OMDocument object. Currently this is not possible
because OMDocument isn't designed to contain anything other than
rootElement.

Possible solutions:

1. Make OMDocument to extend OMNode, and move the addChild* methods
from OMElement to OMNode. I think this is preferable becaus the
addChild, getChild sort of methods seem more natural to OMNode than
OMElement. OMElement can have addChildElement etc, if needed.

2. Make OMDocument to extend OMElement, but i think this is an
overkill, because the Document object isn't really an XML element.

I didn't understand why we need Object or OMContainer as parent. May
be i'm missing something.

- venkat



On 4/12/05, Eran Chinthaka <chinthakae@gmail.com> wrote:
> On Apr 12, 2005 12:58 PM, jayachandra <jayachandra@gmail.com> wrote:
> > Hi devs!
> >
> > Currently OMNodeImpl has the data memeber 'parent' of type OMElement.
> > This appears problematic. Because for document level comments (i mean,
> > comments that are present outside the root element in the XML
> > document) parent becomes OMDocument rather than OMElement. So better
> > have the 'parent' data member as Object. And accordingly the return
> > type of getParent will be Object. I hope this change will not break
> > any existing code, will it???
> 
> This will not break any of the code. But this will add some bad
> things, IMHO, to code. For example, anything can be a parent of any
> node, even a Text node.
> That was the main reason why, we purposely made parent to an OMElement.
> 
> I understand your concern, but ............
> 
> And there is another question coming from me, is it necessary to
> provice the ability to add comments to the Document which is even out
> of the document element ??
> 
> Making this available is of not that useful, but will add some weird
> look to the code.
> 
> We earlier had the concept of OMDocument, but later removed it.
> 
> For your all information : These days all the Sri Lankan people have
> gone home to celebrate  our Sinhalese new year festival. So, there may
> be (including me), a deley in replying to the mails. :(
> 
> Regards,
> Chinthaka
> 
> >
> > Jaya
> > --
> > -- Jaya
> >
> 
> --
> --------------------------------------------------------
> Eran Chinthaka
>

Mime
View raw message