[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xmlspy: does ##other apply to only subsequent target ns

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 19 Feb 2001 23:21:31 +0000
To: "Joseph M. Reagle Jr." <reagle@mit.edu>
Cc: xmlschema-dev@w3.org
Message-ID: <f5bpugefedg.fsf@cogsci.ed.ac.uk>
xs any other xmlspy
"Joseph M. Reagle Jr." <reagle@mit.edu> writes:

I've only got one thing to add to Eddie's (correct as far as I can
see) response.

> I'm playing with XMLSpy and its validator (thought there is a schema
> question in here), and it objects to the following instance:
> <KeyInfo>
>   <KeyRetrievalMethod URI="someKey"
>    Type="http://www.w3.org/2001/02/xmlenc#EncryptedKey"/>
> </KeyInfo>
> 
> in that KeyRetrievalMethod should be from an "##other" namespace.
> 
> xmlenc's KeyInfo is defined as:
> <complexType name='KeyInfoType'>
>   <complexContent>
>     <extension base='ds:KeyInfoType'>
>       <sequence>
>         <element ref='xenc:KeyRetrievalMethod' minOccurs='0'/>  
>       </sequence>
>     </extension>
>   </complexContent>
> </complexType>
> 
> ds:KeyInfoType permits ANY from ##other among other things.

Presuming the content model for ds:KeyInfoType is still something like

  <xs:choice maxOccurs="unbounded">
   . .. 
   <xs:any namespace="##other"/>
  </xs:choice>

You have two problems:

1) the minOccurs on the choice defaults to 1, so your
keyRetrievalMethod is being validated by the choice's required first
iteration, as it were;
2) your content model is ambiguous -- if there were _two_
keyRetrievalMethod elements, the second could stay with the <any> or
go with the added explicit <element>.

Isn't what you want to _restrict_ KeyInfoType with the
KeyRetrievalMethod reference?  This should have the right result.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Monday, 19 February 2001 18:21:34 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.