W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

Re: fairly simple schema is still driving me nuts. HELP.

From: Gino Basso <GBasso@ware2.com>
Date: Wed, 6 Dec 2000 10:27:08 -0500
Message-ID: <8022A77178C84548B49F5965D38776C805F3AF@wopr.ware2.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Cc: "'hlitani@jtcsv.com'" <hlitani@jtcsv.com>, "'Michael.Burns@sas.com'" <Michael.Burns@sas.com>
Hi Michael/Elena,

Elena is basically correct. By specifying a default namespace
"xmlns:http://www.sas.com/Critters" in your XML instance you are saying that
any unprefixed elements belong to this default namespace (which in this case
means all elements, as none are prefixed). However the
"elementFormDefault="unqualified" statement from your schema requires that
only global elements (i.e. Vertebrate) by qualified in an instance, not
local elements (i.e. PreyList). The only thing I'm not sure about is the XML
form Elena's second suggestion. You might need to qualify the inner
'Vertebrate' as well (perhaps Henry can comment here). Also, you'll need to
specify a "LimbType' attribute as this is required according to your schema.
Here is an attempt at a correct instance:

    <foo:Vertebrate xmlns:foo="http://www.sas.com/Critters"
                           Name="MarshHawk" LimbType="wing">
        <foo:Vertebrate Name="Mickey" LimbType="leg" />

Suggest you read through Section 3 of the Primer for further clarification.

Also, unless you've left something out think you can simplify your
definition for the Vertebrate element as follows:

    <element name="Vertebrate" type="critters:VertebrateType" />

Gino Basso
Ware2 Software Corp.
Received on Wednesday, 6 December 2000 10:27:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:48 UTC