Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - >Thread Next - RE: [xml-dev] XML Schema and the Unique Particle Attribution (UPA) rule XML Schema and the Unique Particle Attribution (UPA) ruleTo: <xml-dev@-----.---.---> Date: 8/10/2007 9:22:00 PM <span style='font-size:10.0pt; font-family:Arial'>Hi,<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'>I would like to create an XML Schema for the content model like:<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'><M><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <type>type1</type><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <… several elements specific to type1 …><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'></M><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'><M><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <type>type2</type><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <… several elements specific to type2 …><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'></M><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'>Etc<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'>I was playing with a XML Schema like:<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:complexType name="upa_test"><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:choice><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:sequence><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:element name="type" type="xs:string" fixed="type1" /><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:element name="B" type="xs:string"/><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> </xs:sequence><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:sequence><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:element name="type" type="xs:string" fixed="type2" /><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> <xs:element name="C" type="xs:string"/><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> </xs:sequence><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> </xs:choice><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'> </xs:complexType><o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'>But the processor I am using rejects this Schema saying it violates the UPA rule. Shouldn’t the processor be able to uniquely determine the particle based on the element’s type and/or value? Can someone suggest an alternate XML Schema that would not violate the UPA rule?<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'>Changing the content model to introduce an intermediate level for <type1>, <type2>, etc would work, but I can’t make this change as it would break backward compatibility.<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> <span style='font-size:10.0pt; font-family:Arial'>Thanks<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'>Azariah<o:p></o:p> <span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
