Lists Home |
Date 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
"./HR-XML-AMS-DK" or "/HR-XML-AMS-DK"
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
Fra: Brian Nielsen
Sendt: 5. august 2004 22:34
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"?>
<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:
[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
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,
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
[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
actually could be wrong since "mySubModule.xsd" is not a valid URI.
Looking forward to any answer(s).
IT Strategic Division
33 379 134 (direkte)
25 67 07 45 (mobil)
National IT and Telecom Agency
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