[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSD elementFormDefault="unqualified" destroys the benefits

  • From: George Cristian Bina <george@o...>
  • To: "Costello, Roger L." <costello@m...>
  • Date: Wed, 28 Jan 2009 16:29:42 +0200

Re:  XSD elementFormDefault="unqualified" destroys the benefits
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@l...
> subscribe: xml-dev-subscribe@l...
> 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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.