Jochen,
You always seem to beat the people up who are making
suggestions. I have worked with XML since the days before XML Schema
was dreamt of. As to your point about children. I was not suggesting
that you allow getChild but a getChildElements() which like all the
methods that JAXME gives just returns a List of Objecs. The second
issue is about getting a parent which seems a very reasonable thing,
given that the class structure that JAXME creates is fixed around the
XMl structure and therefore to have a getParent() which just return an
Object that can be used to navigate trees etc would be really useful.
Why do I want this? Like a great number of people I need to
have the XML rendered both as a simple tree for display purposes and as
the great structure that JAXME creates for manipulation of the data.
The two are just complementary needs and to get round it I do not want
to have to hold two data structures.
Please take mine and other comments not as personal slights
against your work, but as comments aimed at improving and making a
solution that is helpful even better.
Martin Roberts
-----Original Message-----
From: Jochen Wiedmann [mailto:[EMAIL PROTECTED]
Sent: 05 December 2005 09:58
To: Roberts,MME,Martin,XBX R
Cc: [EMAIL PROTECTED]; [email protected]
Subject: Re: separate files / adders & getters
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]