OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Shall the targetNamespace be a valid URI?

[ Lists Home | Date Index | Thread Index ]


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@itst.dk <mailto:bni@itst.dk>
33 379 134 (direkte) 
25 67 07 45 (mobil) 
National IT and Telecom Agency 
Holsteinsgade 63 
DK-2100 København Ø 





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS