<?xml version="1.0"?>
<!-- vim: set et sw=2 wm=5 fdm=syntax nofen: -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<!-- change this to no to create a document with lots of whitespace -->
<?rfc compact="yes"?>
<?rfc symrefs="no"?>

<rfc ipr="full3667" docName="draft-rsalz-qname-urn-00.txt">

<front>

  <title abbrev="QNAME URN">The QName URN Namespace</title>

  <author initials="D." surname="Orchard" fullname="David Orchard">
    <organization>BEA Systems, Inc.</organization>
    <address>
      <postal>
        <street>625 W 22nd Ave</street>
        <city>Vancouver</city>
        <region>BC</region>
        <code>V5Z 1Z5</code>
        <country>Canada</country>
      </postal>
      <phone>+1 778-772-8425</phone>
      <email>dorchard@bea.com</email>
      <uri>http://www.bea.com</uri>
    </address>
  </author>

  <author initials="R." surname="Salz" fullname="Rich Salz">
    <organization>DataPower Technology, Inc.</organization>
    <address>
      <postal>
        <street>1 Alewife Center</street>
        <city>Cambridge</city> <region>MA</region> <code>02142</code>
        <country>US</country>
      </postal>
      <phone>+1 617-864-0455</phone>
      <email>rsalz@datapower.com</email>
      <uri>http://www.datapower.com</uri>
    </address>
  </author>

  <date month="December" year="2004" day="9"/>
  <keyword>Namespaces, QName, XML, URN</keyword>

  <abstract>
    <t>This specification defines a Uniform Resource Name namespace for XML
      namespace-qualified names, QNames. As long as the URN is encoded in
      the same character set as the document containing the original QName,
      the Qname URN provides enough information to maintain the semantics,
      and optionally the exact syntax, of the original name.</t>
  </abstract>

</front>

<middle>

  <section anchor="introduction" title="Introduction and Motivation">
    <t>This specification defines a Uniform Resource Name namespace for XML
      namespace-qualified names, QNames. As long as the URN is encoded in
      the same character set as the document containing the original QName,
      the Qname URN provides enough information to maintain the semantics,
      and optionally the exact syntax, of the original name.</t>

    <t>There are a variety of situations when a QName may need to be mapped
      to a URI. For example, when exchanging (or referencing) an identifier
      for an XML element contained within a document, and the medium of
      exchange prefers URIs to QNames, such as an XML Schema anyURI data
      type. Another scenario is for comparing the identifiers, which can be
      simpler by comparing just a string without having to also compare the
      context setting XML namespace attribute that may be declared
      arbitrarily earlier in the document.</t>

      <t>The XML Namespaces specification <xref target="XMLNS" /> does not
        provide a canonical mapping between QNames and URIs. Any XML
        specification that wants to enable identifier exchanges must define
        a language specific QName to URI mapping. There have emerged a
        variety of different algorithms and solutions for the mapping. To
        date, there have been no standardized algorithms available that
        they can re-use, which has increased their efforts. A standardized
        mapping, such as this, should provide increased productivity.</t>

      <t>Almost all of the algorithms for Qname to URI mappings are based
        upon concatenation of the URI and the name with variations based
        upon prefix inclusion, namespace name and name separator, etc.
        These are typically problematic because it is difficult to recover
        the QName from the URI as the namespace name and name separator may
        have already been used in the namespace name. Having the namespace
        name at the end of the identifier string avoids these and other
        problems.</t>

  </section>

  <section anchor="template" title="Namespace Registration Template">
    <t>The following paragraphs contain the URN namespace registration
      data, as defined in  <xref target="RFC2611"/>.</t>
    <t>
      <list style="hanging">
        <t hangText="Namespace ID:"><vspace blankLines="0"/>
          qname</t>
        <t hangText="Registration Information:"><vspace blankLines="0"/>
          Version number: 1<vspace blankLines="0"/>
          Registration date: 2004-11-30</t>
        <t hangText="Declared registrant of the namespace:"><vspace blankLines="0"/>
          The W3C <eref target="http://w3.org/2001/tag/">Technical
          Architecture Group (TAG)</eref>, reachable at <eref
              target="mailto:tag@w3.org">tag@w3.org</eref>.
        </t>
        <t hangText="Declaration of syntactic structure:"><vspace blankLines="0"/>
          The QName URN is structured as four colon-separated fields.
          Note that colons within the fourth field, the URI part, are not
          significant; the entire fourth field is treated as a single
          opaque entity by this URN scheme.<vspace blankLines="1"/>
          The first field identifies the naming scheme.
          The second contains the QName prefix, or an empty string if
          the QName comes from the default namespace, or an asterisk
          if the prefix is not significant.<vspace blankLines="1"/>
          A QName URN is defined by the following ABNF <xref
            target="RFC2234"/>:<figure><artwork><![CDATA[
qnameURN               = "qname" ":" prefix ":" localname ":" uri
prefix                 = ncname / "" / "*"
localname              = ncname
uri                    = <any valid URI>
ncname                 = <see production 4 of [2]>]]></artwork></figure>
          <vspace blankLines="1"/>
          Here are three examples of a QName URN:<figure><artwork><![CDATA[
urn:qname:foo:OK:http://example.com/ws/foo.xsd
urn:qname::OK:http://example.com/ws/foo.xsd
urn:qname:*:Reject:http://w3.org/2002/xkms#
]]></artwork></figure>
        The first correspond to the following element content
        QNames (the element name is not significant):<figure><artwork><![CDATA[
<foo xmlns:foo="http://example.com/ws/foo.xsd">foo:OK</foo>
<foo xmlns="http://example.com/ws/foo.xsd">foo:OK</foo>
]]></artwork></figure>
        The third example would match both of the others, as
        well as an inifinite number of QNames, since
        the namespace prefix is explicitly marked as "don't-care."
        </t>
        <t hangText="Relevant ancillary documentation:"><vspace blankLines="0"/>
          <xref target="XML" />
          <xref target="XMLNS" />
        </t>
        <t hangText="Identifier uniqueness considerations:"><vspace blankLines="0"/>
          An XML QName is semantically defined as a (namespace-uri,
          localname) pair; the namespace prefix is not significant.
          For some applications, such as signature functions, the
          prefix is important and must be preserved.<vspace
            blankLines="1"/>
          The QName URN provides both a one-to-one mapping, that
          preserves the uniquess of the underlying QName, and an
          explicit many-to-one mapping, that does not preserve
          the uniquess when it is not important to do so.</t>
        <t hangText="Identifier persistence considerations:"><vspace blankLines="0"/>
          QName URN's have the same persistance as the underlying
          XML QName from which they are derived.</t>
        <t hangText="Process of identifier assignment:"><vspace blankLines="0"/>
          Assignment of identifiers depends on the original XML QName,
          typically deferring to the namespace URI. Anyone with access to
          an XML QName can create an equivalent QName URN; no registration
          is required.</t>
        <t hangText="Process for identifier resolution:"><vspace blankLines="0"/>
          Inherited from the QName resolution rules (typically the
          namespace URI) from which the QName URN is created.</t>
        <t hangText="Rules for Lexical Equivalence:"><vspace blankLines="0"/>
          If necessary, convert each QName URN to the same encoding.
          The encoding of a QName URN is determined by context, and depends
          on the encoding of the document in which it appears.
          <vspace blankLines="1"/>
          To be lexically equivalent the resultant QName URN's must be
          identical when compared byte-for-byte. To be semantically
          equivalent, ignore the prefix field when comparing bytes.</t>
        <t hangText="Conformance with URN Syntax:"><vspace blankLines="0"/>
          Fully conformant.</t>
        <t hangText="Validation mechanism:"><vspace blankLines="0"/>
          Inherited from the namespace URI of the original QName.</t>
        <t hangText="Scope:"><vspace blankLines="0"/>
          Inherited from the original QName.</t>
      </list>
    </t>
  </section>

  <section anchor="pendants" title="XML and Namespaces 1.1">
    <t>This scheme can also support the XML 1.1 <xref target="XML11" />
      and XML namespaces 1.1 <xref target="XMLNS" /> standards.</t>
    <t>In the 1.1 Namespace specification, namespace URI's (universal
      resource identifiers; see ...xref...) become IRI's (internationalized
      resource identifiers, see ...xref...).
      Although currently an Internet-Draft, and therefore not feasible to
      use as a normative reference here, it is expected that the final RFC
      will continue to define a way to map IRI's to URI's.
      To apply this specification to IRI's, then, first apply that mapping
      before using the syntax here.</t>
  </section>

  <section anchor="security-considerations" title="Security Considerations">
    <t>QName URN's provide a way to transcribe XML QName's into and out of
      URN syntax. Any security considerations are inherited from the
      original QName.</t>
  </section>

</middle>

<back>

  <references title="Normative References">

    <reference anchor="XML"
      target="http://www.w3.org/TR/2004/REC-xml-20040204">
      <front>
        <title>Extensible Markup Language (XML) 1.0 (Third Edition)</title>
        <author initials="T." surname="Bray" fullname="Tim Bray">
          <organization>Textuality and Netscape</organization>
          <address>
            <email>tbray@textuality.com</email>
          </address>
        </author>
        <author initials="J." surname="Paoli" fullname="Jean Paolo">
          <organization>Microsoft</organization>
          <address>
            <email>jeanpa@microsoft.com</email>
          </address>
        </author>
        <author initials="C. M." surname="Sperberg-McQueen" fullname="C. M.
          Sperberg-McQueen">
          <organization>W3C</organization>
          <address>
            <email>cmsmcq@w3.org</email>
          </address>
        </author>
        <author initials="E." surname="Maler" fullname="Eve Maler">
          <organization>Sun Microsystems, Inc.</organization>
          <address>
            <email>eve.maler@east.sun.com</email>
          </address>
        </author>
        <author initials="F." surname="Yergeau" fullname="Francois Yergeau">
          <organization/>
          <address>
            <email>francois@yergeau.com</email>
          </address>
        </author>
        <date month="February" year="2004"/>
      </front>
      <seriesInfo name="W3C" value="Recommendation"/>
    </reference>

    <reference anchor="XML11"
      target="http://www.w3.org/TR/2004/REC-xml-20040204">
      <front>
        <title>Extensible Markup Language (XML) 1.1</title>
        <author initials="T." surname="Bray" fullname="Tim Bray">
          <organization>Textuality and Netscape</organization>
          <address>
            <email>tbray@textuality.com</email>
          </address>
        </author>
        <author initials="J." surname="Paoli" fullname="Jean Paoli">
          <organization>Microsoft</organization>
          <address>
            <email>jeanpa@microsoft.com</email>
          </address>
        </author>
        <author initials="C. M." surname="Sperberg-McQueen" fullname="C. M.
          Sperberg-McQueen">
          <organization>W3C</organization>
          <address>
            <email>cmsmcq@w3.org</email>
          </address>
        </author>
        <author initials="E." surname="Maler" fullname="Eve Maler">
          <organization>Sun Microsystems, Inc.</organization>
          <address>
            <email>eve.maler@east.sun.com</email>
          </address>
        </author>
        <author initials="F." surname="Yergeau" fullname="Francois Yergeau">
          <organization/>
          <address>
            <email>francois@yergeau.com</email>
          </address>
        </author>
        <author initials="J." surname="Cowan" fullname="John Cowan">
          <organization/>
          <address>
            <email>cowan@ccil.org</email>
          </address>
        </author>
        <date month="February" year="2004"/>
      </front>
      <seriesInfo name="W3C" value="Recommendation"/>
    </reference>

    <reference anchor="XMLNS"
      target="http://www.w3.org/TR/1999/REC-xml-names-19990114">
      <front>
        <title abbrev="xmlns">Namespaces in XML</title>
        <author initials="T." surname="Bray" fullname="Tim Bray">
          <organization>Textuality</organization>
          <address>
            <email>tbray@textuality.com</email>
          </address>
        </author>
        <author initials="D." surname="Hollander" fullname="Dave
          Hollander">
          <organization>Hewlett-Packard</organization>
          <address>
            <email>dmh@corp.hp.com</email>
          </address>
        </author>
        <author initials="A." surname="Layman" fullname="Andrew Layman">
          <organization>Microsoft</organization>
          <address>
            <email>andrewl@microsoft.com</email>
          </address>
        </author>
        <date month="January" year="1990"/>
      </front>
      <seriesInfo name="W3C" value="Recommendation"/>
    </reference>

    <reference anchor="XMLNS11"
      target="http://www.w3.org/TR/1999/REC-xml-names-19990114">
      <front>
        <title abbrev="xmlns">Namespaces in XML</title>
        <author initials="T." surname="Bray" fullname="Tim Bray">
          <organization>Textuality</organization>
          <address>
            <email>tbray@textuality.com</email>
          </address>
        </author>
        <author initials="D." surname="Hollander" fullname="Dave
          Hollander">
          <organization>Contivo, Inc.</organization>
          <address>
            <email>dmh@contivo.com</email>
          </address>
        </author>
        <author initials="A." surname="Layman" fullname="Andrew Layman">
          <organization>Microsoft</organization>
          <address>
            <email>andrewl@microsoft.com</email>
          </address>
        </author>
        <author initials="R." surname="Tobin" fullname="Richard Tobin">
          <organization>University of Edinburgh and Markup Technology
            Ltd.</organization>
          <address>
            <email>richard@cogsci.ed.ac.uk</email>
          </address>
        </author>
        <date month="February" year="2004"/>
      </front>
      <seriesInfo name="W3C" value="Recommendation"/>
    </reference>

    <reference anchor='RFC2611'>
      <front>
        <title>URN Namespace Definition Mechanisms</title>
        <author initials='L.' surname='Daigle' fullname='Leslie L. Daigle'>
          <organization>Thinking Cat Enterprises</organization>
          <address>
            <email>leslie@thinkingcat.com</email>
          </address>
        </author>
        <author initials='D.' surname='van Gulik' fullname='Dirk-Willem van Gulik'>
          <organization>ISIS/STA/CEO - TP 270, Joint Research Centre Ispra</organization>
          <address>
          <email>Dirk.vanGulik@jrc.it</email></address></author>
          <author initials='R.' surname='Iannella' fullname='Renato Iannella'>
          <organization>DSTC Pty Ltd</organization>
          <address>
            <email>renato@dstc.edu.au</email>
          </address>
        </author>
        <author initials='P.' surname='Faltstrom' fullname='Patrik Faltstrom'>
          <organization>Tele2/Swipnet</organization>
          <address>
            <email>paf@swip.net</email>
          </address>
        </author>
        <date year='1999' month='June' />
      </front>
      <seriesInfo name='BCP' value='33' />
      <seriesInfo name='RFC' value='2611' />
    </reference>

    <reference anchor='RFC2234'>
      <front>
        <title abbrev='ABNF for Syntax Specifications'>Augmented BNF for Syntax Specifications: ABNF</title>
        <author initials='D.H.' surname='Crocker' fullname='David H. Crocker'>
          <organization>Internet Mail Consortium</organization>
          <address>
            <email>dcrocker@imc.org</email>
          </address>
        </author>
        <author initials='P.' surname='Overell' fullname='Paul Overell'>
          <organization>Demon Internet Ltd</organization>
          <address>
            <email>paulo@turnpike.com</email>
          </address>
        </author>
        <date month='November' year='1997' />
      </front>
      <seriesInfo name='RFC' value='2234' />
    </reference>

  </references>

</back>

</rfc>
