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

schemaLocation declaration after namespace usage

From: Tobias Koenig <tobias.koenig@trolltech.com>
Date: Wed, 21 Jan 2009 14:50:38 +0100
To: xmlschema-dev@w3.org
Message-Id: <200901211450.39293.tobias.koenig@trolltech.com>
schemaLocation declaration after namespace usage

Hej,

http://www.w3.org/TR/xmlschema-1/#schema-loc 4) says that no schemaLocation declaration
is allowed to appear, after the namespace has been used for a validation of an element or attribute.

The two instance documents addB162 and addB163 from the schema test suite are defined
as the following:
---------------------------------
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	  xsi:noNamespaceSchemaLocation="test93490_5.xsd" 	
	  xmlns:foo="foo"
	  xmlns:bar="bar">

	<foo:elem1 xsi:schemaLocation="foo test93490_1.xsd" />
	<bar:elem2 xsi:schemaLocation="bar test93490_3.xsd" />
	<elem2 xsi:schemaLocation="bar test93490_4.xsd" />
</root>
--------------------------------
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	  xsi:noNamespaceSchemaLocation="test93490_5.xsd" 	
	  xmlns:foo="foo"
	  xmlns:bar="bar">

	<foo:elem1 xsi:schemaLocation="foo test93490_1.xsd" />
	<bar:elem2 xsi:schemaLocation="bar test93490_3.xsd" />
	<elem2>
		<a>
			<b>
				<c xsi:schemaLocation="foo test93490_1.xsd" />
			</b>
		</a>
	</elem2>
</root>
--------------------------------
While the first document is invalid according to the test result and saxon validator, the
second is valid. However they seem to be quite similar to me. In both cases the a
schemaLocation declaration exists after it has been used previously. In the first case
'bar' is reused and in the second 'foo'. The only difference I see is, that the first uses
different locations (test93490_3.xsd vs. test93490_4.xsd) while the second uses the
same (test93490_1.xsd). But is the location used as part of the namespace here?!?

Ciao,
Tobias
Received on Thursday, 5 February 2009 13:50:58 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.