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

Re: Problem with cascading XML Schemas

  • From: "bryan rasmussen" <rasmussen.bryan@g...>
  • To: "Thorsten Rock" <thorsten.rock@w...>
  • Date: Fri, 27 Jun 2008 14:01:54 +0200

Re:  Problem with cascading XML Schemas
That's a xerces error, nothing jumps out at me from your schemas
although there could be something my tired eyes aren't picking up, so
the problem is probably that xerces is parsing the definition twice
and then getting the conflict:
http://xerces.apache.org/xerces2-j/faq-grammars.html

Earlier versions of Xerces were notorious for this kind of problem, I
thought it was fixed by default with the newest version?

Cheers,
Bryan Rasmussen

On Fri, Jun 27, 2008 at 1:51 PM, Thorsten Rock
<thorsten.rock@w...> wrote:
> 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.