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

RE: Problem with cascading XML Schemas

  • From: "Michael Kay" <mike@s...>
  • To: "'Thorsten Rock'" <thorsten.rock@w...>,<xml-dev@l...>
  • Date: Fri, 27 Jun 2008 13:33:10 +0100

RE:  Problem with cascading XML Schemas

I can't see anything wrong with this. It works fine in Saxon.

Perhaps you can ignore the warning?

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Thorsten Rock [mailto:thorsten.rock@w...] 
> Sent: 27 June 2008 12:52
> To: xml-dev@l...
> Subject:  Problem with cascading XML Schemas
> 
> For maximum scalability I want to use cascading xml schemas; 
> for example one schema for basic datatypes (schema A), one 
> for a group of applications (schema B) and one for the 
> application itself (schema C). To keep everything clearly 
> laid out, I'd prefer every schema to have it's own namespace.
> 
> However, if I import schema A into schema B and then import 
> schema B into schema C, I can't access schema A's datatypes 
> from schema C.
> 
> If I import schema A into schema B and then import schema A 
> _and_ schema B into schema C, I get an validation error in 
> schema C ("Warning - one of the grammar(s) returned from the 
> user's grammar pool is in conflict with another grammar").
> 
> SCHEMA A (schema_basic.xsd):
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema	xmlns		= "http://www.acme.org/basic"
> 		targetNamespace	= "http://www.acme.org/basic"
> 		xmlns:xs	= "http://www.w3.org/2001/XMLSchema">
> 	<xs:simpleType name="smallRange">
> 		<xs:restriction base="xs:integer">
> 			<xs:minInclusive value="2"/>
> 			<xs:maxInclusive value="5"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:schema>
> 
> SCHEMA B (schema_extended.xsd):
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema	xmlns:basic	= "http://www.acme.org/basic"
> 		xmlns		= "http://www.acme.org/extended"
> 		targetNamespace	= "http://www.acme.org/extended"
> 		xmlns:xs	= "http://www.w3.org/2001/XMLSchema">
> 	<xs:import namespace="http://www.acme.org/basic"  
> schemaLocation="schema_basic.xsd"/>
> 	<xs:simpleType name="extendedRange">
> 		<xs:union memberTypes="basic:smallRange">
> 			<xs:simpleType>
> 				<xs:restriction base="xs:string">
> 					<xs:enumeration value="more"/>
> 				</xs:restriction>
> 			</xs:simpleType>
> 		</xs:union>
> 	</xs:simpleType>
> </xs:schema>
> 
> SCHEMA C (schema.xsd):
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema	xmlns:basic	= "http://www.acme.org/basic"
> 		xmlns:ext	= "http://www.acme.org/extended"
> 		xmlns		= "http://www.acme.org/specific"
> 		targetNamespace	= "http://www.acme.org/specific"
> 		xmlns:xs	= "http://www.w3.org/2001/XMLSchema">
> 	<xs:import namespace="http://www.acme.org/basic"  
> schemaLocation="schema_basic.xsd"/>
> 	<xs:import namespace="http://www.acme.org/extended"  
> schemaLocation="schema_extended.xsd"/>
> 	<xs:element name="quantities">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element name="quantity" 
> type="basic:smallRange"/>
> 				<xs:element 
> name="large_quantity" type="ext:extendedRange"/>
> 			</xs:sequence>
> 		</xs:complexType>
> 	</xs:element>
> </xs:schema>
> 
> What's my mistake here? What would be a sensible approach 
> when I want to keep schema A, B and C in different namespaces?
> 
> Thank you very much
> Thorsten Rock
> 
> ______________________________________________________________
> _________
> 
> 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.