XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] XSD elementFormDefault="unqualified" destroys thebenefits of namespace modularity

 
Hi George,

Here are the four schemas, using elementFormDefault="unqualified." Following the schemas is an instance document, which validated against the schemas.  /Roger

-----------------------------------------------------
Camera.xsd
-----------------------------------------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://www.camera.org";
            xmlns="http://www.camera.org";
            xmlns:nikon="http://www.nikon.com";
            xmlns:olympus="http://www.olympus.com";
            xmlns:pentax="http://www.pentax.com";
            elementFormDefault="unqualified">

    <xsd:import namespace="http://www.nikon.com";
                schemaLocation="Nikon.xsd"/>
    <xsd:import namespace="http://www.olympus.com";
                schemaLocation="Olympus.xsd"/>
    <xsd:import namespace="http://www.pentax.com";
                schemaLocation="Pentax.xsd"/>

    <xsd:element name="camera">
        <xsd:complexType>
             <xsd:sequence>
                 <xsd:element name="body" type="nikon:body_type"/>
                 <xsd:element name="lens" type="olympus:lens_type"/>
                 <xsd:element name="manual_adapter"
                         type="pentax:manual_adapter_type"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

-----------------------------------------------------
Nikon.xsd
-----------------------------------------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://www.nikon.com";
            xmlns="http://www.nikon.com";
            elementFormDefault="unqualified">

    <xsd:complexType name="body_type">
        <xsd:sequence>
            <xsd:element name="description" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>

-----------------------------------------------------
Olympus.xsd
-----------------------------------------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://www.olympus.com";
            xmlns="http://www.olympus.com";
            elementFormDefault="unqualified">

    <xsd:complexType name="lens_type">
        <xsd:sequence>
            <xsd:element name="zoom" type="xsd:string"/>
            <xsd:element name="f-stop" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>

-----------------------------------------------------
Pentax.xsd
-----------------------------------------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://www.pentax.com";
            xmlns="http://www.pentax.com";
            elementFormDefault="unqualified">

    <xsd:complexType name="manual_adapter_type">
        <xsd:sequence>
            <xsd:element name="speed" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>

-----------------------------------------------------
Camera.xml
-----------------------------------------------------
<?xml version="1.0"?>
<c:camera xmlns:c="http://www.camera.org";>

    <body>
        <description>Ergonomically designed 
             casing for easy handling
        </description>
    </body>

    <lens>
        <zoom>300mm</zoom>
        <f-stop>1.2</f-stop>
    </lens>

    <manual_adapter>
        <speed>1/10,000 sec to 100 sec</speed>
    </manual_adapter>

</c:camera>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS