Network Working Group P. Thierry Internet-Draft Thierry Technologies Intended status: Experimental August 7, 2013 Expires: February 8, 2014 BULK Simple XML namespace draft-thierry-bulk-xml-00 Abstract This specification describes a BULK serialization of XML data. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. 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." This Internet-Draft will expire on February 8, 2014. Copyright Notice Copyright (c) 2013 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 Simplified BSD License. Thierry Expires February 8, 2014 [Page 1] Internet-Draft BULK-XML August 2013 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Conventions and Terminology . . . . . . . . . . . . . . . . 3 2. BULK XML namespace . . . . . . . . . . . . . . . . . . . . . . 3 2.1. XML 1.0 entity . . . . . . . . . . . . . . . . . . . . . . 4 2.2. XML 1.1 entity . . . . . . . . . . . . . . . . . . . . . . 4 2.3. Processing instruction . . . . . . . . . . . . . . . . . . 4 2.4. Comment . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.5. Element . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.6. Attribute . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.7. xml: namespace . . . . . . . . . . . . . . . . . . . . . . 5 2.8. xmlns: namespace . . . . . . . . . . . . . . . . . . . . . 5 2.9. space preservation . . . . . . . . . . . . . . . . . . . . 5 3. References . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1. Normative References . . . . . . . . . . . . . . . . . . . 5 3.2. Informative references . . . . . . . . . . . . . . . . . . 5 Appendix A. Shorthand examples . . . . . . . . . . . . . . . . . . 6 Thierry Expires February 8, 2014 [Page 2] Internet-Draft BULK-XML August 2013 1. Introduction 1.1. Conventions and Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. Literal numerical values are provided in decimal or hexadecimal as appropriate. Hexadecimal literals are prefixed with "0x" to distinguish them from decimal literals. BULK bytes sequences and expressions are described with the same conventions than used in the BULK 1.0 specification [BULK1] 2. BULK XML namespace The Simple XML namespace is an official namespace identified by the UUID (BULK, http://www.w3.org/XML/Core/). It is a simplistic notation for the XML data available after parsing an XML document is complete. As such, it doesn't provide a way to serialize some components of an XML document, such as the contents of the DTD or unparsed entities. In particular, the encoding declaration of the XML prolog is not serialized, as BULK sreams already carry encoding information. As for any other BULK data, everywhere within an Simple XML form, a "stringenc" form can appear. An application writing Simple XML data SHOULD use "rdf:prefix" to denote element and attribute prefixed names and arrays for unprefixed names. The semantics of the "rdf:prefix" form are application- dependent; an application could choose to evaluate it without changing its value beforehand, thus using expanded names (cf. [XML-NAMES10] and [XML-NAMES11]), or follow the XML Infoset [XML-INFOSET] principle of keeping the namespace and local part of the name separate. Note that Simple XML cannot store the original prefix associated with a namespace. The goal is to be able to serialize just enough data from a parsed XML document that an equivalent XML document can be unserialized. By equivalent, we mean that it would have the same semantics as the original XML document for applications using this XML format (but defining this latter equivalence in a remotely decent way is outside the scope of this specification). Character data (corresponding to "CDATA" sections and "#PCDATA" in XML) SHOULD be serialized as arrays. Thierry Expires February 8, 2014 [Page 3] Internet-Draft BULK-XML August 2013 Note: authors of BULK XML namespaces are encouraged to define names in such a way that frequently-used expressions can be serialized as compactly as possible, using "rdf:prefix", "define", "subst" or any similar constructs. This is particularly straightforward and useful for enumerated attributes (but could be used for more complex structures). 2.1. XML 1.0 entity name "0x1" (mnemonic: "xml1.0" ) shape "( xml1.0 {content} )" This form denotes an entity (document entity or external entity) whose XML version is 1.0. Type: "Entity" 2.2. XML 1.1 entity name "0x2" (mnemonic: "xml1.1" ) shape "( xml1.1 {content} )" This form denotes an entity (document entity or external entity) whose XML version is 1.1. Type: "Entity" 2.3. Processing instruction name "0x3" (mnemonic: "pi" ) shape "( pi {target} {content} )" Type: "PI" 2.4. Comment name "0x4" (mnemonic: "comment" ) shape "( comment {content} )" Type: "Comment" Thierry Expires February 8, 2014 [Page 4] Internet-Draft BULK-XML August 2013 2.5. Element name "0x5" (mnemonic: "element" ) shape "( element {name} {content} )" Type: "Element" 2.6. Attribute name "0x6" (mnemonic: "attribute" ) shape "( attribute {name} {value} )" Type: "Attribute" 2.7. xml: namespace name "0x7" (mnemonic: "xml:" ) value "( prefix "http://www.w3.org/XML/1998/namespace" )" 2.8. xmlns: namespace name "0x8" (mnemonic: "xmlns:" ) value "( prefix "http://www.w3.org/2000/xmlns/" )" 2.9. space preservation name "0x9" (mnemonic: "preserve" ) value "( attribute ( xml: "space" ) "preserve" )" 3. References 3.1. Normative References [BULK1] Thierry, P., "Binary Uniform Language Kit 1.0", draft-thierry-bulk-02 (work in progress), August 2013. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. 3.2. Informative references [XML-INFOSET] Cowan, J. and R. Tobin, "XML Information Set (Second Edition)", February 2004, Thierry Expires February 8, 2014 [Page 5] Internet-Draft BULK-XML August 2013 . [XML-NAMES10] Bray, T., Hollander, D., Layman, A., Tobin, R., and H. Thompson, "Namespaces in XML 1.0 (Third Edition)", December 2009, . [XML-NAMES11] Bray, T., Hollander, D., Layman, A., and R. Tobin, "Namespaces in XML 1.1 (Second Edition)", August 2006, . [XML10] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", 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)", August 2006, . Appendix A. Shorthand examples Here are a couple of examples of the kind of definitions that can be used to increase compactness in an XML serialization. First, this specification defines general forms for XML data. But namespaces can be dedicated to XML formats, with names for each element, attribute or PI: o "( define ?rfc ( subst ( pi "rfc" ( rest 0 ) ) ) )" o "( define t ( subst ( element "t" ( rest 0 ) ) ) )" Secondly, recurring patterns can be abbreviated: o "( define thang ( subst ( t ( attribute "hangText" ( arg 0 ) ) ( rest 1 )" o "( define verb ( subst ( spanx ( attribute "verb" ) ( rest 0 ) ) ) )" Author's Address Pierre Thierry Thierry Technologies EMail: pierre@nothos.net Thierry Expires February 8, 2014 [Page 6]