Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Stanimir Stamenkov Newsgroups: comp.lang.java.programmer Subject: Re: XML Date: Wed, 10 Aug 2016 22:05:32 +0300 Organization: A noiseless patient Spider Lines: 42 Message-ID: References: <34f5f605-db80-441c-9730-ceecf445c1a8@googlegroups.com> <0176078c-ab98-4e66-ba3e-b14ee88b58e0@googlegroups.com> <487a50aa-8e4b-460a-9824-bd23c26d4c02@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 10 Aug 2016 19:05:31 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="d489b61b6c2749b456b7448c648cfd22"; logging-data="30976"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JQZOR89VJOMFOm8gqQDu9" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 In-Reply-To: X-Face: "@)%Vlap6d%OVYDS}B4YUWE@yUy+^!w/+.q.,c5kjI#+uG?kYP&r/pTjNWgo:g[A,O=AL3/ j&4Le2cau$ ... ... If the two different instances of "DataRecord" map to two different types, then the only way to resolve this is the XML Schema 'xsi:type' attribute – the Unmarshaller would use it to instantiate object of the necessary type. As a final word, you may notice in XML an element name is generally used to define a single element type (if you're familiar with the XML DTD). It is the much more complex XML Schema which allows you do other "fancy" stuff at the expense of added meta information to the instance document like 'xsi:type' attributes. You need to design wisely both of the XML representation and Java classes bound to it. Good luck in this effort. -- Stanimir