I've worked on XML/Java binding frameworks before (http://sourceforge.net/projects/bob/ and others) and the mechanism we used to lookup a particular child element is it's attribute value. Getting a child, a child list, or a parent reference is definitely useful if you are using your JAXB architecture to manipulate an object structure as your business/application objects.
As for generating different files for each class, no it's not necessary. But I find it rather clean and it's how I'm used to dealing with my objects. Plus I find I avoid weird compilation errors. But thanks for the feedback nonetheless. Now I know that JAXB does not support i) separate files and ii) objects finders/removers as an architecture. /tim -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 5:13 AM To: [EMAIL PROTECTED] Cc: Washington, Tim; [email protected] Subject: RE: separate files / adders & getters 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) ------------------------------------------------------------------------------ This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. ---------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
