Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [Updated] XML Schema 1.1 Tutorial

From: "Costello, Roger L." <costello@-----.--->
To: "xmlschema-dev@--.---" <-------------@--.--->
Date: 7/29/2009 10:24:00 PM
 
Thanks Noah and Michael. I made the suggested changes. See slides 27-28:

http://www.xfront.com/xml-schema-1-1/xml-schema-1-1.ppt

/Roger

> -----Original Message-----
> From: noah_mendelsohn@u... [mailto:noah_mendelsohn@u...] 
> Sent: Wednesday, July 29, 2009 4:04 PM
> To: Costello, Roger L.
> Cc: xmlschema-dev@w...
> Subject: Re: [Updated] XML Schema 1.1 Tutorial
> 
> On Slide 27, you say:
> 
> "With XML Schema 1.0 you could not restrict a type defined in another 
> schema. In XML Schema 1.1 you can by adding a targetNamespace 
> attribute to 
> each element and attribute in the restriction"
> 
> I think it would be more accurate to say:]
> 
> "A  XSD 1.0 Schema Document with one targetNamespace could 
> not restrict a 
> type using elements from another targetNamespace.  In XML 
> Schema 1.1, you 
> can do this, by adding a targetNamespace attribute to each 
> such "foreign" 
> element and attribute in the restriction"
> 
> Reasons for the corrections:
> 
> * Neither XSD 1.0 nor XSD 1.1 speak directly about 
> restrictions across 
> "schemas". 
> 
> * Schema documents are the standard way of setting down schema 
> information, but not the only possible way (APIs might be 
> another.)  As 
> far as I know, there's nothing in XSD 1.0 that would prevent such 
> cross-targetNamespace restriction using representations other 
> than Schema 
> Documents.  The issue is:  schema documents (I.e. the 
> standard XML form 
> for writing down a schema) lacked the capability.  XSD 1.1 allows it.
> 
> * You only need to supply the targetNamespace if the elements 
> happen to be 
> foreign (foreign is not a formal term, but I hope it's clear 
> for purposes 
> of this note.  Although it wouldn't come up in the simplest 
> cases, one can 
> imagine a case in which some of the elements were in fact from the 
> targetNamespace of the schema document, and for those no 
> targetNamespace 
> would be needed.
> 
> Actually, looking at your example, I think it lacks important prefix 
> definitions.  I think this would be clearer.  This defines a type 
> lib:BookInLibrary based on books:Book:
> 
> <xs:schema      targetNamespace="http://www.libraries.org"
>                 xmlns:books="Book.xsd">
>     <xs:import namespace="http://www.book.org"
>                   schemaLocation="Book.xsd"/>
> 
>     <xs:complexType name="BookInLibrary">
>         <xs:complexContent>
>             <xs:restriction base="books:Book">
>                 <xs:sequence>
>                     <xs:element name="Title" type="xs:string" 
>  targetNamespace="http://www.book.org"/>
>                     <xs:element name="Author" type="xs:string" 
> maxOccurs="2" 
>  targetNamespace="http://www.book.org"/>
>                     <xs:element name="Date" type="xs:gYear" 
>  targetNamespace="http://www.book.org"/>
>                     <xs:element name="ISBN" type="xs:string" 
>  targetNamespace="http://www.book.org"/>
>                     <xs:element name="Publisher" type="xs:string" 
>  targetNamespace="http://www.book.org"/> 
>                 </xs:sequence>
>             </xs:restriction>
>         </xs:complexContent>
>     </xs:complexType> 
> </xs:schema>
> 
> 
> --------------------------------------
> Noah Mendelsohn 
> IBM Corporation
> One Rogers Street
> Cambridge, MA 02142
> 1-617-693-4036
> --------------------------------------
> 
> 
> 
> 
> 
> 
> 
> 
> "Costello, Roger L." <costello@m...>
> Sent by: xmlschema-dev-request@w...
> 07/24/2009 02:16 PM
>  
>         To:     "xmlschema-dev@w..." <xmlschema-dev@w...>
>         cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
>         Subject:        [Updated] XML Schema 1.1 Tutorial
> 
> 
> 
> Hi Folks,
> 
> I updated my XML Schema 1.1 Tutorial:
> 
> http://www.xfront.com/xml-schema-1-1/xml-schema-1-1.ppt
> 
> Here are the changes:
> 
> 1. At the beginning I added a "5 minute intro" section that 
> quickly covers 
> all of the new capabilities in XML Schema 1.1
> 
> 2. I completely revised the section on targetNamespace 
> (thanks to Michael 
> Kay and Michael Sperberg-McQueen for straightening me out)
> 
> 3. I added a few more slides on xs:error
> 
> Thanks to Noah and Mukul for their suggestions.
> 
> I will be announcing the tutorial on xml-dev shortly.
> 
> /Roger
> 
> 
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent