[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] XSD elementFormDefault="unqualified" destroys the benefitsof namespace modularity
- From: George Cristian Bina <george@oxygenxml.com>
- To: "Costello, Roger L." <costello@mitre.org>
- Date: Wed, 28 Jan 2009 16:29:42 +0200
Hi Roger,
Interesting :), I did not thought about putting local elements from
other schema/namespace inside local elements from the main
schema/namespace directly. I always thought about local elements as part
of the content of a global element from the same schema - and probably
the unqualified form makes sense only in this case (similar with
attributes in no namespace, that are local to the element that contains
them).
Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Costello, Roger L. wrote:
>
> 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>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]