Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XML Schema and the Unique Particle Attribution (UPA) rule

From: "Azariah Jeyakumar" <ajeyakumar@----.--->
To: <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>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent