Network Working Group D. Orchard Internet-Draft Ayogo Games, Inc. Expires: June 18, 2010 R. Salz IBM J. Reschke, Ed. greenbytes December 15, 2009 The QName URN Namespace draft-rsalz-qname-urn-01 Abstract 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. Editorial Note (To be removed by RFC Editor before publication) Please send comments to the xml-dev mailing list (). XML versions, latest edits and the issues list for this document are available from . Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at Orchard, et al. Expires June 18, 2010 [Page 1] Internet-Draft QNAME URN December 2009 http://www.ietf.org/shadow.html. This Internet-Draft will expire on June 18, 2010. Copyright Notice Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the BSD License. This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English. Orchard, et al. Expires June 18, 2010 [Page 2] Internet-Draft QNAME URN December 2009 Table of Contents 1. Introduction and Motivation . . . . . . . . . . . . . . . . . 4 2. Namespace Registration Template . . . . . . . . . . . . . . . 4 3. XML and Namespaces 1.1 . . . . . . . . . . . . . . . . . . . . 7 4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 5. Normative References . . . . . . . . . . . . . . . . . . . . . 7 Appendix A. Change Log (to be removed by RFC Editor before publication) . . . . . . . . . . . . . . . . . . . . 8 A.1. Since draft-rsalz-qname-urn-00 . . . . . . . . . . . . . . 8 Appendix B. Open issues (to be removed by RFC Editor prior to publication) . . . . . . . . . . . . . . . . . . . . 8 B.1. contacts . . . . . . . . . . . . . . . . . . . . . . . . . 8 B.2. mailing-list . . . . . . . . . . . . . . . . . . . . . . . 8 B.3. curie . . . . . . . . . . . . . . . . . . . . . . . . . . 8 B.4. qname-vs-expname . . . . . . . . . . . . . . . . . . . . . 9 B.5. i18n . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 B.6. reg-info . . . . . . . . . . . . . . . . . . . . . . . . . 9 B.7. registrant . . . . . . . . . . . . . . . . . . . . . . . . 9 B.8. any-uri . . . . . . . . . . . . . . . . . . . . . . . . . 9 B.9. examples . . . . . . . . . . . . . . . . . . . . . . . . . 10 B.10. xml11 . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 10 Orchard, et al. Expires June 18, 2010 [Page 3] Internet-Draft QNAME URN December 2009 1. Introduction and Motivation 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. 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. The XML Namespaces specification [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. 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. 2. Namespace Registration Template The following paragraphs contain the URN namespace registration data, as defined in [RFC3406]. Namespace ID: qname Registration Information: Version number: 1 Orchard, et al. Expires June 18, 2010 [Page 4] Internet-Draft QNAME URN December 2009 Registration date: 2004-11-30 Declared registrant of the namespace: The W3C Technical Architecture Group (TAG) [1], reachable at tag@w3.org [2]. Declaration of syntactic structure: 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. 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. A QName URN is defined by the following ABNF [RFC5234]: qnameURN = "qname" ":" prefix ":" localname ":" uri prefix = ncname / "" / "*" localname = ncname uri = ncname = Here are three examples of a QName URN: 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# The first correspond to the following element content QNames (the element name is not significant): foo:OK foo:OK 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." Relevant ancillary documentation: [XML] [XMLNS] Orchard, et al. Expires June 18, 2010 [Page 5] Internet-Draft QNAME URN December 2009 Identifier uniqueness considerations: 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. 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. Identifier persistence considerations: QName URN's have the same persistance as the underlying XML QName from which they are derived. Process of identifier assignment: 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. Process for identifier resolution: Inherited from the QName resolution rules (typically the namespace URI) from which the QName URN is created. Rules for Lexical Equivalence: 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. 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. Conformance with URN Syntax: Fully conformant. Validation mechanism: Inherited from the namespace URI of the original QName. Orchard, et al. Expires June 18, 2010 [Page 6] Internet-Draft QNAME URN December 2009 Scope: Inherited from the original QName. 3. XML and Namespaces 1.1 This scheme can also support the XML 1.1 [XML11] and XML namespaces 1.1 [XMLNS11] standards. 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. 4. Security Considerations 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. 5. Normative References [XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", W3C REC-xml-20081126, November 2008, . [XML11] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., Yergeau, F., and J. Cowan, "Extensible Markup Language (XML) 1.1 (Second Edition)", W3C REC-xml11-20060816, August 2006, . [XMLNS] Bray, T., Hollander, D., Layman, A., Tobin, R., and H. Henry, "Namespaces in XML 1.0 (Third Edition)", W3C REC- xml-names-20091208, December 2009, . [XMLNS11] Bray, T., Hollander, D., Layman, A., and R. Tobin, "Namespaces in XML (Second Edition)", W3C REC-xml-names11- 20060816, August 2006, . Orchard, et al. Expires June 18, 2010 [Page 7] Internet-Draft QNAME URN December 2009 [RFC3406] Daigle, L., van Gulik, D., Iannella, R., and P. Faltstrom, "Uniform Resource Names (URN) Namespace Definition Mechanisms", BCP 33, RFC 3406, October 2002. [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008. [1] [2] Appendix A. Change Log (to be removed by RFC Editor before publication) A.1. Since draft-rsalz-qname-urn-00 Updated references and fix reference to XMLNS which was meant to reference XMLNS11. Add a set of issues: "any-uri", "contacts", "curie", "examples", "i18n", "mailing-list", "qname-vs-expname", "reg-info", "registrant", "xml11". Appendix B. Open issues (to be removed by RFC Editor prior to publication) B.1. contacts Type: edit julian.reschke@greenbytes.de (2009-12-11): Update author information. B.2. mailing-list Type: edit julian.reschke@greenbytes.de (2009-12-12): In the boilerplate, state where this Internet Draft should be discussed. Proposal: xml-dev. B.3. curie Type: edit julian.reschke@greenbytes.de (2009-12-12): Maybe we should clarify the relation with CURIEs (which can be confused with QNames)? Orchard, et al. Expires June 18, 2010 [Page 8] Internet-Draft QNAME URN December 2009 B.4. qname-vs-expname Type: edit julian.reschke@greenbytes.de (2009-12-12): There's a risk that we confuse people by claiming this is about QNames. What we map to URNs is the triple (namespace-name, local-name, prefix), where the prefix is optional. The tuple (namespace-name, local-name) is the *expanded name*, not the QName. Options: (1) just clarify the prose, (2) rename the URN scheme (is it in use already?) to something like "xmlname". B.5. i18n Type: change julian.reschke@greenbytes.de (2009-12-11): Need to state how non- ASCII characters are mapped to the URN. B.6. reg-info In Section 2: Type: edit julian.reschke@greenbytes.de (2009-12-11): Update registration info. B.7. registrant In Section 2: Type: edit julian.reschke@greenbytes.de (2009-12-11): Update registrant info. B.8. any-uri In Section 2: Type: change julian.reschke@greenbytes.de (2009-12-12): Need a grammar for "any valid URI". Do we follow stricly XMLNS, which would make it a "URI reference" as per RFC 3986, or do we tolerate junk and/or IRIs (no offense). Also, we need to state that this part of the URN will be empty for elements that are in no namespace (right?). Orchard, et al. Expires June 18, 2010 [Page 9] Internet-Draft QNAME URN December 2009 B.9. examples In Section 2: Type: change julian.reschke@greenbytes.de (2009-12-11): Having just examples of QNames in element content might be confusing to people not familiar with that use case; we also should have at least one example for an XML element name, and for a QName in content. (potentially also move the examples out of the registration template?) B.10. xml11 Type: change julian.reschke@greenbytes.de (2009-12-11): Consider removing any material related to XML 1.1. Authors' Addresses David Orchard Ayogo Games, Inc. Email: orchard@pacificspirit.com Rich Salz IBM Email: rsalz@us.ibm.com Julian F. Reschke (editor) greenbytes GmbH Hafenweg 16 Muenster, NW 48155 Germany Email: julian.reschke@greenbytes.de URI: http://greenbytes.de/tech/webdav/ Orchard, et al. Expires June 18, 2010 [Page 10]