[oXygen-user] XSD 1.1 XML Page Generation

Radu Coravu
Mon Jul 4 06:56:45 CDT 2011


Hi Robert,

Oxygen does not yet support XML Schema 1.1 when generating XML 
instances. Maybe a future version will remove this limitation.
The only support for XML Schema 1.1 we currently offer is validation 
using Saxon EE.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 7/3/2011 8:27 PM, Robert Leif wrote:
> To: Radu Coravu  and oXygen User ML
>
>
>     Study Subject
>
> The use of the openContent element in the schema below was part of
> trying to determine how XHTML5 and XML could work together. If the XSD
> 1.1 openContent element were usable in XML and  XHTML5, it would aid the
> development of combined implementations.
>
>
>     Bug: XSD 1.1 openContent mode="interleave in XML Page
>
> Unfortunately, the XML page that was generated by an XSD1.1 schema shown
> below was incorrect.
>
> The schema below, which includes an openContent element successfully
> validated
>
> “SystemID: D:\XML\Schema\Schema1_1\interleave\books.xsd
>
> Main validation file: D:\XML\Schema\Schema1_1\interleave\books.xsd
>
> Engine name: Saxon-EE 9.3.0.5
>
> Severity: info
>
> Description: Validation successful.
>
> <?xml version="1.0" encoding="UTF-8"?>”
>
> The test case is based upon slides 266 and 217 of XML Schema 1.1 by
> Roger L. Costello, (http://www.xfront.com) dated 24 March 2011. Slide
> 217 is a complete XML page.
>
> http://www.xfront.com/files/tutorials.html
>
> Then pressing xml schema 1.1. This is followed by going “XML Schema 1.1
> Tutorial”
>
> And then going to the hyperlink labeled
>
> Here is the tutorial: _XML Schema 1.1_(PowerPoint document). It appears
> that there are at least two versions with different dates and slide
> numbers of this PowerPoint presentation that can be found with a Google
> search.
>
> XSD1.1 Schema
>
> </xs:schema><?xml version="1.0" encoding="UTF-8"?>
> <xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"
>      targetNamespace="http://www.books.org"xmlns="http://www.books.org"
>      elementFormDefault="qualified">
> <xs:elementname="Book">
> <xs:complexType>
> <xs:openContentmode="interleave">
> <xs:anynamespace="http://www.r.org"processContents="strict"/>
> </xs:openContent>
> <xs:sequence>
> <xs:elementname="Title"type="xs:string"/>
> <xs:elementname="Author"type="xs:string"/>
> <xs:elementname="Date"type="xs:string"/>
> <xs:elementname="ISBN"type="xs:string"/>
> <xs:elementname="Publisher"type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> When I attempted to use Tools.Generate XML schema, I received the
> following error message.
>
> Description:
> imap://radu_coravu@mail.sync.ro:143/fetch%3EUID%3E.INBOX%3E105345?header=quotebody&part=1.1.2&filename=image001.jpg
>
> I ignored the error and generated:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Book xmlns="http://www.books.org"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="http://www.books.org
> file:/D:/XML/Schema/Schema1_1/interleave/books.xsd
> <http://www.books.org%20file:/D:/XML/Schema/Schema1_1/interleave/books.xsd>">
>
> </Book>
>
> If I comment out
>
> <!--xs:openContentmode="interleave">
> <xs:anynamespace="http://www.r.org"processContents="strict"/>
> </xs:openContent-->
> I was able to generate:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Bookxmlns="http://www.books.org"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.books.org
> file:/D:/XML/Schema/Schema1_1/interleave/books.xsd">
> <Title>Title0</Title>
> <Author>Author0</Author>
> <Date>Date0</Date>
> <ISBN>ISBN0</ISBN>
> <Publisher>Publisher0</Publisher>
> </Book>
>
> The result with the above XML page was:
>
> SystemID: D:\XML\Schema\Schema1_1\interleave\book_XSD_1.xml
>
> Main validation file: D:\XML\Schema\Schema1_1\interleave\book_XSD_1.xml
>
> Engine name: Saxon-EE 9.3.0.5
>
> Severity: info
>
> Description: Validation _successful_.
>
> I created an r.xsd schema based on the XML page shown in :
>
> The comments in r.xsd (below) are the values shown in the XML page I
> separate type definitions by a stylized comment *<!—xxxxxxxxxxxx**à*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"
>      targetNamespace="http://www.r.org"xmlns="http://www.r.org"
>      elementFormDefault="qualified">
> <xs:elementname="Binding"type="Binding_Type"/>
> <xs:simpleTypename="Binding_Type">
> <xs:restrictionbase="xs:token">
> <xs:enumerationvalue="Hardcover"/>
> <xs:enumerationvalue="Soft"/>
> </xs:restriction>
> </xs:simpleType>
>
> <!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
> <!--r:Binding>Hardcover</r:Binding-->
> <!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
> <xs:simpleTypename="Category_Type">
> <xs:restrictionbase="xs:token">
> <xs:enumerationvalue="Non-fiction"/>
> <xs:enumerationvalue="Fiction"/>
> </xs:restriction>
> </xs:simpleType>
> <!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
> <xs:elementname="Size"type="xs:int"/>
> <!--r:Size>5 x 7</r:Size -->
> <xs:elementname="InStock"type="xs:boolean"/>
> <!--r:InStock>true</r:InStock-->
> <xs:elementname="Category"type="Category_Type"/>
> <!--r:Category>Non-fiction</r:Category -->
> <xs:elementname="NumPages"type="xs:int"/>
> <!--r:NumPages>299</r:NumPages-->
> <xs:elementname="AvailableOnTape"type="xs:boolean"/>
> <!--r:AvailableOnTape>false</r:AvailableOnTape-->
> </xs:schema>
> ----------------------------------------------------------------
>
> Test XML page that includes one element (<r:Size>5 x 7</r:Size>) from
> the schema (r.xsd) that contains the interleaved elements
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Bookxmlns="http://www.books.org"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:r="http://www.r.org"
> xsi:schemaLocation="http://www.books.org
> file:/D:/XML/Schema/Schema1_1/interleave/books.xsd">
> <!--r:Binding>Hardcover</r:Binding-->
> <Title>My Life and Times</Title>
> <r:Size>5 x 7</r:Size>
> <Author>Paul McCartney</Author>
> <!--r:InStock>true</r:InStock-->
> <Date>1998</Date>
> <!--r:Category>Non-fiction</r:Category-->
> <ISBN>1-56592-235-2</ISBN>
> <!--r:NumPages>299</r:NumPages-->
> <Publisher>McMillin Publishing</Publisher>
> <!--r:AvailableOnTape>false</r:AvailableOnTape-->
> </Book>
>
> “Validating this XML page resulted in
>
> SystemID: D:\XML\Schema\Schema1_1\interleave\book_Inter1.xml
>
> Main validation file: D:\XML\Schema\Schema1_1\interleave\book_Inter1.xml
>
> Engine name: Saxon-EE 9.3.0.5
>
> Severity: error
>
> Description: In content of element <Book>: The content model does not
> allow element <r:Size> to appear here. Expected:
> {http://www.books.org}Author
>
> Start location: 8:11
>
> SystemID: D:\XML\Schema\Schema1_1\interleave\book_Inter1.xml
>
> Main validation file: D:\XML\Schema\Schema1_1\interleave\book_Inter1.xml
>
> Engine name: Saxon-EE 9.3.0.5
>
> Severity: fatal
>
> Description: One or more validation errors were reported
>
> Start location: 17:8.
>
> However, the web page was well formed.”
>
> Thank you.
>
> Bob Leif
>




More information about the oXygen-user mailing list