Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: UPA Question

From: "Michael Kay" <mike@--------.--->
To: "'George Cristian Bina'" <george@---------.--->
Date: 11/28/2006 5:11:00 PM
Thanks for the pointer. The second sentence is clear enough. The chain of
reasoning, though, is obscure to say the least! Starting from the premise
that the constraint is expressed at the component level, I would have drawn
exactly the opposite conclusion. The Note seems to imply that at some stage
the contents of the model group are copied to create cloned particles with
distinct identity (that's the only way the "origins... [would be] no longer
evident"), and I can't see any normative text that would lead one to that
conclusion. On the contrary, the normative text says that named model groups
are incorporated "by reference".

Actually, there's a small class of UPA violations that Saxon doesn't detect,
and it seems I might have to add this one to the list. Saxon actually allows
you to have an ambiguous choice of two element particles provided they are
both references to the same element declaration. This is the rule that ought
to be in the spec, because it's unique identification of an element
declaration that actually matters, but it's not the way the 1.0 spec is
written.

Michael Kay
http://www.saxonica.com/
  

> -----Original Message-----
> From: George Cristian Bina [mailto:george@o...] 
> Sent: 28 November 2006 16:54
> To: Michael Kay
> Cc: 'Erik Johnson'; xmlschema-dev@w...
> Subject: Re: UPA Question
> 
> Hi Mike,
> 
> What do you think about the following fragment? To me it 
> seems that it states clearly that referring to a group from 
> two locations results in different particles.
> 
> http://www.w3.org/TR/xmlschema-1/#cos-nonambig
> ***
> Since this constraint is expressed at the component level, it 
> applies to content models whose origins (e.g. via type 
> derivation and references to named model groups) are no 
> longer evident. So particles at different points in the 
> content model are always distinct from one another, even if 
> they originated from the same named model group.
> ***
> 
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger 
> www.---.com
> 
> 
> Michael Kay wrote:
> > 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@w...
> >     [mailto:xmlschema-dev-request@w...] *On Behalf Of 
> *Erik Johnson
> >     *Sent:* 28 November 2006 01:18
> >     *To:* xmlschema-dev@w...
> >     *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>
> > 
> >      
> > 
> >      
> > 
> 


From ejohnson@e... Tue Nov 28 17:34:37 2006
Received: from aji.w3.org ([133.27.228.225])
	by frink.w3.org w


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