Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Doubt in Unique Particle Attribution Constraint

From: "C. M. Sperberg-McQueen" <cmsmcq@-------------.--->
To: Bharath Kumar Reddy T <bharathkr@------.--->
Date: 2/18/2009 10:50:00 AM
On 17 Feb 2009, at 22:29 , Bharath Kumar Reddy T wrote:


 > According to spec. Two non-group particles overlap if

 >    They are both element declaration particles one of
 >    whose {name} and {target namespace} are the same as
 >    those of an element declaration in the other's
 >    =B7substitution group=B7.

I think this is true.

 > In the following schema, element ref = b and element ref =
 > c are both element declarations and c's name and target
 > namespace are same as b's substitution group's name and
 > targetnamespace. So, they both overlap. and both are under
 > <choice> model group. So, the content model is
 > non-deterministic.

I think you are oversimplifying here.  Element 'b' names 'c'
as its substitution group head, but element 'c' is declared
with block="substitution", which means that 'b' is *not* in
the substitution group of 'c'.  The substitution group of
'c' consists, according to the definition of 'substitution
group' in XSD 1.0, of the elements which

   - are c, or name c or any element in c's "potential
     substitution group" as their substitution group head
   - have {abstract} = false
   - are validly substitutable for c subject to c's
     {disallowed substitutions} (i.e. its block attribute)

Element 'b' fails that last test, so it's not substitutable
for element 'c'.  And similarly it's not substitutable for 'd'.

 > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
 >
 >   <xs:element name="a" type="xs:short" substitutionGroup="b"/>
 >   <xs:element name="b" type="xs:decimal" substitutionGroup="c"/>
 >   <xs:element name="c" type="xs:decimal" block="substitution"  =

substitutionGroup="d"/>
 >   <xs:element name="d" block="substitution"/>
 >   <xs:element name="foo"/>
 >
 >   <xs:complexType name="base">
 >     <xs:choice>
 >       <xs:element ref="b"/>
 >       <xs:element ref="c"/>
 >       <xs:element ref="d"/>
 >       <xs:element ref="foo"/>
 >     </xs:choice>
 >   </xs:complexType>
 >
 >   <xs:element name="doc" type="base"/>
 >
 > </xs:schema>

If you see

   <doc><b>

at the beginning of a document instance, how many
content-model particles could you be matching?

You could be matching the reference to 'b'.

You cannot be matching the references to 'c' or 'd', since
they both have block="substitution".

You cannot be matching the reference to 'foo', since the
names 'foo' and 'b' differ.

So the particle to which the 'b' element in the instance
must be attributed is uniquely determined.  The content
model thus satisfies, for this case, the Unique Particle
Attribution rule.  (For this case, and in fact for all
cases.)

 > But one of the XML parsers is not giving any error about
 > the non-deterministic content model.

One of the parsers is correct!

 > Please reply me whether the elements <xs:element ref="b"/>
 > and <xs:element ref="c"/> will overlap or not. and whether
 > the content model is non-deterministic or not.

I hope this helps.

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************


From cmsmcq@b... Thu Feb 19 02:47:25 2009
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exi


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