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

"Joseph M. Reagle Jr." wrote:

> 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.
>
> Now is this error from: 1. an include/extension adds the included
> namespace to its concept of self (either in schema or a Spy bug?) (I think
> this is unlikely) 2. the validator is trying to validate the
> KeyRetrievalMethod under the ANY constraint in the ds:KeyInfoType
> (wouldn't this still work assume #1 above is wrong?) instead of the
> KeyRetrivalMethod enc:KeyInfoType?

I did some testing with XML Spy a couple of weeks ago and I found lot's of
bugs when using <any> element and <anyAttribute>. I posted a message to XML
Spy with all the errors I found but I never got a reply...

> This has also got me to wondering about the ordering/precedence of
> extensions. In [1] I presume the state/zip must come after
> name/street/city in a sequence. What is the content model of the derived
> type if state/zip was actually a choice content model?

If the type "USAddress" would be declared as:

<complexType name="USAddress">
   <complexContent>
      <extension base="ipo:Address">
         <choice>
            <element name="state" type="ipo:USState"/>
            <element name="zip"   type="positiveInteger"/>
         </choice>
      </extension>
   </complexContent>
</complexType>

If you resolve the content model of "USAddress" it would look like this:

<complexType name="USAddress">
   <sequence>
      <element name="name"   type="string"/>
      <element name="street" type="string"/>
      <element name="city"   type="string"/>
   </sequence>
   <choice>
      <element name="state" type="ipo:USState"/>
      <element name="zip"   type="positiveInteger"/>
   </choice>
</complexType>

Which means an instance must have <name>, <street> and <city> in sequence
followed by a choice of either <state> or <zip>.

Cheers,
/Eddie

> [1] http://www.w3.org/TR/xmlschema-0/#address.xsd
>
> Regards,              | GON OUT |
>                       | BACKSON |
> Joseph M. Reagle Jr.  |  BISY   |
> reagle@mit.edu        | BACKSON | http://reagle.org/joseph/
> PGP ID:    0C 69 D4 E8 F2 70 24 33  B4 5E 5E EC 35 E6 FB 88

Received on Monday, 19 February 2001 17:55:36 UTC