On 12/5/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I feel that this seperation between DOM and JAXB is rather
> artificial. It is good to be able to work with the data in both ways.
> For example to be able to get all children of a node and also getFoo().
> I also think that to be able to get a parent of a node is critical as
> this allows you to receive an object in a function and travers back to
> its parents if that enables you to get at for example document wide
> values.
You're free to have a different opinion. But I'd bet that you are
underestimating the resulting problems by far.
The decision to avoid parents and child references wasn't taken by me:
It was done in the JAXB specification group. But personally, I am
quite sure, that they did an excellent job in that area.
I'll give you a small example. Suggest the following:
<xs:complexType name="foo">
<xs:sequence>
<xs:sequence>
<xs:element name="a"/>
<xs:element name="b"/>
</xs:sequence>
<xs:sequence>
<xs:element name="c"/>
<xs:element name="b"/>
</xs:sequence>
</xs:sequence>
</xs:complexType>
Now, which "b" child should I give you, when you're asking me for the
"b" child? And that is just a very simple example for the underlying
semantical problems.
Your judge is typical for people, which have either just began to work
with XML or are able to concentrate on very simple structures. I
can't.
Jochen
--
Often it does seem a pity that Noah and his party did not miss the
boat. (Mark Twain)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]