- From: Shropshire, Andrew A <shropshire@att.com>
- Date: Thu, 29 Oct 2009 09:51:09 +0000
- To: <www-xml-schema-comments@w3.org>
Working Group, Just in case you all are not aware of this issue already: Problems with XML schema. Unique Particle Attribution. Say you have a hierarchy: 1st Generation --------------- xa xab xad xsd:any (optional - placeholder for future extension, 1st Generation apps will not use this element) Now in 2nd Generation apps, it is desired to add an optional xae member of xa. Because of the Unique Particle Attribution rule, this optional element may not precede xsd:any, and so we must remove xsd:any as so: 2nd Generation -------------- xa xab xad xae (optional) Now because there is no xsd:any we cannot add another element xaf in a 3rd generation app: 3rd Generation -------------- xa xab xad xae (optional) xaf (optional) Because the 2nd Generation apps won't accept xaf (1st generation apps will). With these 3 generations: 1 may receive from 1, 2, and 3 1 may send to 1, 2, and 3 2 may receive from 1 and 2 2 may send to 1, 2, and 3 3 may receive from 1, 2, and 3 3 may send to 1 and 3 Solution ----------- XML Schema SHOULD but DOES NOT (thus a flaw in the design) allow optional elements to be placed before an xsd:any optional element. Use xpath/DOM to marshal the XML to java. This will ignore all the optional extensions. Do your own marshalling to XML. xpath package --> javax.xml.xpath Regards, Andrew Shropshire AT&T Government Solutions, Inc. 703-506-5708 This e-mail and any files transmitted with it are AT&T property, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. ------_=_NextPart_001_01CA587D.3F5EE975--
Received on Thursday, 29 October 2009 11:58:03 UTC