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


Help: OASIS Mailing Lists Help | MarkMail Help



   Valid or invalid RFC URI?

[ Lists Home | Date Index | Thread Index ]

Thanks for your input and insight to my latest posting " [xml-dev] Shall the
targetNamespace be a valid URI?". I would like to do two followup question,
to get something straight and maybe correct my understanding of things:

I have myself concluded that the "namespace" URI "HR-XML-AMS-DK" is an
INVALID relative URI, though no one has made any comment on it. I get the
feeling that some calls all "not absolute uris" for a relative uri!
According to the RFC it should have been something like


Am i right or wrong? 

Du any of you have experince with parsers that will malfunction og warn on
the use af a relative uri? I personally have only experienced it with the
xml-security package from apache.

Thanks for your earlier replies to:
* Bjoern Hoehrmann
* Chiusano Joseph
* Michael Kay
* John Cowan

Best regards
Brian Nielsen

-----Oprindelig meddelelse-----
Fra: Brian Nielsen 
Sendt: 5. august 2004 22:34
Til: 'xml-dev@lists.xml.org'
Emne: [xml-dev] Shall the targetNamespace be a valid URI?

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" 
  <element name="FamilyName" type="string"/>

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


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.

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.

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". 

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
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";
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 Ø 

The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://www.oasis-open.org/mlmanage/index.php>


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

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