RE: UPA Question

UPA is violated if the particle with which to validate ElementA1 cannot be
uniquely determined. So I think it boils down to a question of whether the
ElementA1 particle reached via grpA is the same particle as the ElementA1
particle reached via grpB and grpA. In Saxon it is, and therefore no UPA
violation is reported. The fact that the same particle can be selected in
two different ways is not an ambiguity, because it is the same particle.
 
The content model clearly would be ambiguous if you expanded the named
groups by copying them. But I don't think the spec says you should do that;
in fact it says that named groups are incorporated into a term "by
reference". So I would defend Saxon's result. 
 
However, the spec itself admits that the "notion of component identity ...
is only incompletely defined by this version of this specification." So it's
muddy water.
 
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Erik Johnson
Sent: 28 November 2006 01:18
To: xmlschema-dev@w3.org
Subject: UPA Question



I have two toolkits (from the same company, BTW) that compile the schema
shown below differently.  One says the schema is fine while the other says
the choice inside grpC/ElementC1 violates the UPA rule.  This example looks
a bit contrived, but it's a reduction from something a lot more complex that
obviously could be re-factored.   On the surface, I can see why one might
think having grpA in choice particles at two levels within ElementC1 makes
the content ambiguous.  But after thinking about it, I don't think that the
content model is ambiguous.  My question is which toolkit is right and which
one gets my bug report?  Thanks!

 

<xs:schema id="XMLSchema1" 

                  targetNamespace="uri:erik:upaQuestion"

                  elementFormDefault="qualified"

                  xmlns="uri:erik:upaQuestion"

                  xmlns:tns="uri:erik:upaQuestion"

                  xmlns:xs="http://www.w3.org/2001/XMLSchema">

 

      <xs:group name="grpA">

            <xs:sequence>

                  <xs:element name="ElementA1"/>

            </xs:sequence>

      </xs:group>

 

      <xs:group name="grpB">

            <xs:choice>

                  <xs:element name="ElementB1" />

                  <xs:group ref="tns:grpA"/>

            </xs:choice>

      </xs:group>

 

      <xs:group name="grpC">

            <xs:sequence>

                  <xs:element name="ElementC1">

                        <xs:complexType>

                              <xs:sequence>

                                    <xs:choice>

                                          <xs:group ref="tns:grpB"/>

                                          <xs:group ref="tns:grpA"/>

                                    </xs:choice>

                              </xs:sequence>

                        </xs:complexType>

                  </xs:element>

            </xs:sequence>

      </xs:group>

 

      <xs:element name="RootElement">

            <xs:complexType>

                  <xs:choice>

                        <xs:group ref="tns:grpC"/>

                        <xs:sequence>

                              <xs:element name="OtherStuff" />

                        </xs:sequence>

                  </xs:choice>

            </xs:complexType>

      </xs:element>

 

</xs:schema>

 

 

Received on Tuesday, 28 November 2006 16:13:40 UTC