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"
 
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
                           xsi:schemaLocation="http://www.sas.com/Critters
Vertebrate.xsd"
                           Name="MarshHawk" LimbType="wing">
        <PreyList>
        <foo:Vertebrate Name="Mickey" LimbType="leg" />
        </PreyList>
    </foo:Vertebrate>

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" />

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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT