Local vs. Global declarations

Hi,

I am confused by the errors reported for the following document/schema
combination. What have I forgotten?

In the document, which some of you will recognize as the xmlspec
doctype :-), I have a header, front matter, and a body:

<spec xmlns='http://www.w3.org/2000/xmlspec'
      xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'>

<header>
<title>Test</title>
</header>

<front>
<div1><head>foo</head>
</div1>
</front>

<body>
<div1><head>bar</head>
</div1>

</body>
</spec>

The schema for this fragment declares 'body' globally and 'front' locally:

<schema xmlns='http://www.w3.org/1999/XMLSchema'
        targetNamespace='http://www.w3.org/2000/xmlspec'
        xmlns:spec='http://www.w3.org/2000/xmlspec'
        elementFormDefault='qualified'>

<complexType name='spec'>
  <element ref='spec:header'/>

  <element name='front' minOccurs='0'>
    <element ref='spec:div1' minOccurs='1' maxOccurs='unbounded'/>
  </element>

  <element ref='spec:body'/>
</complexType>

<complexType name='body'>
  <sequence>
    <element ref='spec:div1' minOccurs='0' maxOccurs='unbounded'/>
  </sequence>
</complexType>

<complexType name='header'>
  <element ref='spec:title'/>
</complexType>

<complexType name='title' content='mixed'>
</complexType>

<complexType name='div1'>
  <element ref='spec:head'/>
</complexType>

<complexType name='head' content='mixed'>
</complexType>

<element name='spec' type='spec:spec'/>
<element name='header' type='spec:header'/>
<element name='body' type='spec:body'/>
<element name='div1' type='spec:div1'/>
<element name='head' type='spec:head'/>
<element name='title' type='spec:title'/>

</schema>

Given my setting for elementFormDefault, I would have thought that the
instance above was entirely valid. But I get the following warning
(from xsv):

<warning char='1' line='9' resource='file:///share/projects/sun/schema/test/test.xml'>allowing {http://www.w3.org/2000/xmlspec}:div1 because it matched wildcard(##any)</warning>
<warning>validating it against div1</warning>

What's wrong with my schema that it doesn't validate front?

Also, I don't see how I've enabled '##any'-matching, I don't want it.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | certain: adj., insufficiently analyzed
http://nwalsh.com/            | 

Received on Wednesday, 30 August 2000 10:59:43 UTC