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

Re: LC-117: Locating schema resources

  • From: ht@c... (Henry S. Thompson)
  • To: Curt Arnold <CurtA@t...>
  • Date: Sat, 23 Sep 2000 11:51:22 +0100

xsd import example
Curt Arnold <CurtA@t...> writes:

> This is in response to
> http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000JulSep/0209.
> html on XML Schema last call issue LC-117
> http://www.w3.org/2000/05/12-xmlschema-lcissues#locating-schema-resources.
> 
> Noah Mendelsohn wrote:
> 
> > >>  there is not a mechanism to identify a schema
> > >>  resource to be used to validate an XML 1.0
> > >>  (pre-namespace) compatible document.
> >
> > In fact, as described in section 6.3.2 of the
> > structures specification, the noNamespaceSchemaLocation
> > attribute is provided for exactly this purpose.
> 
> Using xsi:noNamespaceSchemaLocation to specify a schema location
> hint would cause the document to be invalid according to a
> pre-existing DTD.  The only way that I could see that a document
> could declare that it adheres to a specific schema while retaining
> validity to an existing DTD would be through use of a processing
> instruction.

Not so.  Suppose the DTD is at foo.dtd, and the doc't element is baz.
Then simply write

<?xml version='1.0'?>
<!DOCTYPE baz SYSTEM "foo.dtd" [
<!ATTLIST baz xmlns:xsi CDATA #IMPLIED
               xsi:noNamespaceSchemaLocation CDATA #IMPLIED>
]>
<baz xmlns:xsi="http://www.w3.org/2000/10/XMLSchema"
     xsi:noNamespaceSchemaLocation="http://www.example.com/MySchemas/foo.xsd">
. . .
</baz>

> >
> > There is no need to explicitly import (since you are
> > talking about multiple namespaces, I presume you meant
> > import rather than include) namespace B into the schema
> > for namespace A, except in the case where constructions
> > from B are explicitly and directly used in creating
> > declarations for A.
> 
> I did mean import (sorry) and I was precisely talking about instances
> where
> constructions from multiple namespaces are used in creating a schema
> resource that combines elements from multiple namespaces.
> 
> For example, if I have an "http://www.example.com/namespace/automobile"
> namespace that imports distinct namespaces for major subsystems
> ("..drivetrain", "..engine", "..interior", "..frame", "..suspension",
> "..tires", "..transport", "..finance", etc) plus generic namespaces like
> XHTML and uses elements from these distinct namespaces to describe the
> overall picture of a car.  Each individual namespace may be owned by a
> different organization (either an internal division or WG or an external
> organization) that may independently revised.
> 
> When I assume version "1.0" of the schema for "../automobile", I specify
> through my <xsd:import>'s specific hints that indicate that version
> "1.0" of
> this namespace uses elements from version "1.15" of "drivetrain", "1.7"
> of
> "engine", "1.3" of interior, etc.
> 
> <xsd:schema
> targetNamespace="http://www.example.com/namespace/automobile">
>     <xsd:import namespace="http://www.example.com/namespace/drivetrain"
> schemaLocation="http://www.example.com/schemas/drivetrain/115"/>
>     <xsd:import.../>
>     <xsd:import.../>
>     <xsd:element name="automobile">
>         <xsd:complexType>
>             <xsd:element ref="drivetrain:transmission"/>
>         </xsd:complexType>
>     </xsd:element>
> </xsd:schema>
> 
> For me to use schemaLocation to specify that this schema resource should
> be
> used to validate its 15 or so imported namespaces, I have to do
> something
> like:
> 
> <automobile xmlns="http://www.example.com/namespace/automobile"
> 
> xmlns:drivetrain="http://www.example.com/namespace/drivetrain"
>                    
> xmlns:engine="http://www.example.com/namespace/engine"
> 
> xsi:schemaLocation="http://www.example.com/namespace/automobile
> http://www.example.com/schema/automobile10.xsd
> http://www.example.com/namespace/drivertrain
> http://www.example.com/schema/automobile10.xsd
> http://www.example.com/namespace/engine
> http://www.example.com/schema/automobile10.xsd
> ....
> >

Any one hint is sufficient -- once you've got a schema corresponding
to a schema document (e.g. http://www.example.com/schema/automobile10.xsd)
you've got all the components defined/declared _or imported/included_
in it.

> The tension comes from a dual nature of schemaLocation.  It tries to
> act both as a retrieval location for a resource (a file:// URL that
> an XML editor validates during development)

yes

> and an assertion of
> conformance to a known universally identified schema resource (a URN
> or http:// URL that would rarely be dereferenced) that a server
> would typically ignore before validating with a schema resource of
> its choosing.

no, that's the namespace URI, if you choose to use it that way.

> Based on your message, I going state that I'm not satisfied with the
> proposed resolution (basically to leave schema resource location
> substantially unchanged with the exception of LC-116) in that there
> are substantial use cases (XML 1.0 compatible documents and
> documents where a large number of namespaces are governed by a small
> set of schema resources) where the suggested mechanism of asserting
> schema conformance is unsatisfactory to the point that alternative
> solutions will be used.

I hope I've addressed both these concerns above.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@c...
		     URL: http://www.ltg.ed.ac.uk/~ht/

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.