URI versus URI Reference versus IRI

A URI identifies a resource. A URI reference identifies a part of a resource. A URI reference may contain a fragment identifier separated from the URI by an octothorp ( # ); a plain URI may not. For example, http://www.w3.org/TR/REC-xml-names/ is a URI, but http://www.w3.org/TR/REC-xml- names /#Philosophy is a URI reference.

Most XML- related specifications, such as Namespaces in XML , are defined in terms of URI references rather than URIs. For example, the W3C XML Schema Language simple type xsd:anyURI actually indicates that elements with that type are URI references. In casual conversation and writing, most people don't bother to make the distinction. Nonetheless, it can be important. For example, the system identifier in the document type declaration can be a URI but not a URI reference.


I've heard it claimed that relative URIs are URI references, not true URIs, and the authors of the XML specification seem to have believed this. However, the URI specification, RFC 2396, does not support this belief. It clearly describes both relative URIs and relative URI references. Perhaps the authors intended to require all URIs to be absolute; however, if this is the case, they failed to do so. The only difference between a URI and a URI reference is that the latter allows a fragment identifier while the former does not.

Currently, the IETF is working on Internationalized Resource Identifiers (IRIs). These are similar to URIs except that they allow non-ASCII characters such as z and that must be escaped with percent symbols in URIs. The specification is not finished yet, but several XML specifications are already referring to this. For instance, the XLink href attribute actually contains an IRI, not a URI.

Effective XML. 50 Specific Ways to Improve Your XML
Effective XML: 50 Specific Ways to Improve Your XML
ISBN: 0321150406
EAN: 2147483647
Year: 2002
Pages: 144

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net