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

Shall the targetNamespace be a valid URI?


targetnamespace

Hopefully someone on this list can answer this question, since I haven't
been able to find it elsewhere.

I have the following schema:

<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="HR-XML-AMS-DK" 
        xmlns="http://www.w3.org/2001/XMLSchema"
	  elementFormDefault="qualified" 
        attributeFormDefault="unqualified">
  <element name="FamilyName" type="string"/>
</schema>

I ran it through IBMs Schema Quality Checker, and got a "WARNING" -
"HR-XML-AMS-DK is not a valid absolute URI. No scheme found in URI.". 

Uhmm warning what does that mean, is the schema okay or not? I looked at
the XML Schema specification, and the closest i came was, that the
attribute "targetNamespace" is of type xs:anyURI, and there it says:

<quote src="http://www.w3.org/TR/xmlschema-2/#anyURI">
[Definition:]   anyURI represents a Uniform Resource Identifier
Reference (URI). An anyURI value can be absolute or relative, and may
have an optional fragment identifier (i.e., it may be a URI Reference).
This type should be used to specify the intention that the value
fulfills the role of a URI as defined by [RFC 2396], as amended by [RFC
2732].

.......

NOTE: Each URI scheme imposes specialized syntax rules for URIs in that
scheme, including restrictions on the syntax of allowed fragement
identifiers. Because it is impractical for processors to check that a
value is a context-appropriate URI reference, this specification follows
the lead of [RFC 2396] (as amended by [RFC 2732]) in this matter: such
rules and restrictions are not part of type validity and are not checked
by ·minimally conforming· processors. Thus in practice the above
definition imposes only very modest obligations on ·minimally
conforming· processors.
</quote>

So does "such rules and restrictions are not part of type validity and
are not checked by ·minimally conforming· processors" mean that any
sequence of characters will do? The mentioned lead from RFC2396 that
I've been able to find is:

<quote src="http://www.faqs.org/rfcs/rfc2396.html" hint="section 1.2,
2nd paragraph">
The URI scheme (Section 3.1) defines the namespace of the URI, and
   thus may further restrict the syntax and semantics of identifiers
   using that scheme.  This specification defines those elements of the
   URI syntax that are either required of all URI schemes or are common
   to many URI schemes.  It thus defines the syntax and semantics that
   are needed to implement a scheme-independent parsing mechanism for
   URI references, such that the scheme-dependent handling of a URI can
   be postponed until the scheme-dependent semantics are needed.  We use
   the term URL below when describing syntax or semantics that only
   apply to locators.
</quote>

So this only applies to schemes, but my targetNamespace is not an
absolute URI, and actually not a relative URI either, since the second
character is an <upalpha>. How critical is this? Let's look at the
"Namespaces in XML" recommendation, surely there I'll find the answer

<quote src="http://www.w3.org/TR/REC-xml-names/">
[Definition:] An XML namespace is a collection of names, identified by a
URI reference [RFC2396], which are used in XML documents as element
types and attribute names. XML namespaces differ from the "namespaces"
conventionally used in computing disciplines in that the XML version has
internal structure and is not, mathematically speaking, a set. These
issues are discussed in "A. The Internal Structure of XML Namespaces". 
</quote>


This doesn't say anything like SHALL og SHOULD, and "The default
namespace can be set to the empty string" is not a valid URI.

I've found an old posting by Michael Kay
(http://lists.w3.org/Archives/Public/xml-names-editor/2002Nov/0010.html)
that gives me an idea of the state of things in relation to URI/IRI, but
if that's the case, I guess it's not important whether a namespace is a
valid URI or not!


Not that I've thought about it earlier, but the same problem relates to
the validity of ex. URI's in the xs:include schemaLocation hint, where
<xs:include namespace="http://myuri.dk"
schemaLocation="mySubModule.xsd"/> 
actually could be wrong since "mySubModule.xsd" is not a valid URI.

Looking forward to any answer(s).


Best regards


--- 

Brian Nielsen 
Enterprise Architect
IT Strategic Division 
bni@i... <mailto:bni@i...>
33 379 134 (direkte) 
25 67 07 45 (mobil) 
National IT and Telecom Agency 
Holsteinsgade 63 
DK-2100 København Ø 


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.