INTERNET-DRAFT S. Legg draft-legg-xed-glue-01.txt Adacel Technologies Intended Category: Standards Track D. Prager Deakin University December 19, 2003 XED: Schema Language Integration Copyright (C) The Internet Society (2003). All Rights Reserved. Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. 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 http://www.ietf.org/shadow.html. Distribution of this document is unlimited. Technical discussion of this document should take place on the XED developers mailing list . Please send editorial comments directly to the editor . This Internet-Draft expires on 19 June 2004. Abstract This document defines the means by which an Abstract Syntax Notation One (ASN.1) specification can incorporate the definitions of types and elements in specifications written in other Extensible Markup Language (XML) schema languages. References to XML Schema types and elements, RELAX NG named patterns and elements, and Document Type Legg & Prager Expires 19 June 2004 [Page 1] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 Declaration element types are supported. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Conventions. . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Representing Markup as ASN.1 Values. . . . . . . . . . . . . . 3 4. Supporting ASN.1 Types . . . . . . . . . . . . . . . . . . . . 5 4.1. The AnyURI Type. . . . . . . . . . . . . . . . . . . . . 5 4.2. The NCName Type. . . . . . . . . . . . . . . . . . . . . 5 5. Referencing Foreign Types. . . . . . . . . . . . . . . . . . . 6 6. Referencing Foreign Elements . . . . . . . . . . . . . . . . . 7 7. Security Considerations. . . . . . . . . . . . . . . . . . . . 9 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 9 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 10 9.1. Normative References . . . . . . . . . . . . . . . . . . 10 9.2. Informative References . . . . . . . . . . . . . . . . . 11 10. Intellectual Property Notice . . . . . . . . . . . . . . . . . 11 11. Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 11 Appendix A. ASN.1 for Schema Language Integration. . . . . . . . . 12 Full Copyright Statement . . . . . . . . . . . . . . . . . . . . . 13 1. Introduction This document defines the means by which an Abstract Syntax Notation One (ASN.1) [X680] specification can incorporate the definitions of types and elements in specifications written in other Extensible Markup Language (XML) [XML] schema languages. References to XML Schema [XSD1] types and elements, RELAX NG [RNG] named patterns and elements, and Document Type Declaration (DTD) [XML] element types are supported. Non-ASN.1 definitions are supported by first defining an ASN.1 type whose values can contain arbitrary markup, and then defining constraints on that type to restrict the content to specific nominated datatypes from non-ASN.1 schema definitions. The ASN.1 definitions in this document are consolidated in Appendix A. 2. Conventions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", and "MAY" in this document are to be interpreted as described in BCP 14, RFC 2119 [BCP14]. The key word "OPTIONAL" is exclusively used with its ASN.1 meaning. This specification makes use of definitions from the XML Information Legg & Prager Expires 19 June 2004 [Page 2] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 Set (Infoset) [ISET]. The term "element" shall be taken to mean an Infoset element information item. The term "attribute" shall be taken to mean an Infoset attribute information item. A reference to a ASN.1 production [X680] (e.g., UserDefinedConstraint) is a reference to the text in an ASN.1 specification corresponding to that production. 3. Representing Markup as ASN.1 Values A value of the AnyType ASN.1 type holds arbitrary content of an element (but not the start-tag and end-tag, or empty-element tag), plus the context required to correctly interpret that content. AnyType ::= SEQUENCE { prolog [0] UTF8String (SIZE(1..MAX)) OPTIONAL, context [1] UTF8String (SIZE(1..MAX)) OPTIONAL, attributes [2] UTF8String (SIZE(1..MAX)) OPTIONAL, content [3] UTF8String (SIZE(1..MAX)) OPTIONAL } With respect to some element whose content is represented by a value of the AnyType type: - the prolog component of the value contains, from the XML document containing the element, the text corresponding to the prolog production [XML], or the sufficient (well-formed and valid) part thereof to define the entity references appearing in the context, attributes and content components of the value, - the context component of the value contains a whitespace separated list of the [namespace attributes] of the ancestors of the element, if any, plus any [attributes] of the ancestor elements which are inherited by their element children, - the attributes component of the value contains text corresponding to the [attributes] of the element, if any, - the content component of the value contains the text of the content of the element between the start-tag and end-tag. The component is absent if there are no characters between the start-tag and end-tag, or if the element uses an empty-element tag. Leading and trailing whitespace corresponding to the S production [XML] in the prolog, context and attributes components MAY be omitted. Multiple whitespace characters corresponding to the S production in the prolog, context and attributes components MAY be Legg & Prager Expires 19 June 2004 [Page 3] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 replaced with a single space character. Any entity references in the context, attributes and content components MAY be replaced by their replacement text so that the prolog component can be omitted. If the prolog component is absent then XML version 1.0 is assumed. Note that the Robust XML Encoding Rules [RXER] have special provisions for encoding values of the AnyType type. For other encoding rules, values of the AnyType type are encoded according to the ASN.1 type definition of AnyType. Example Consider the following XML document: ]> &TRUE; The AnyType value corresponding to the content of the element is, in ASN.1 value notation [X680]: { prolog { "", lf, "", lf "]>", lf }, context "xmlns:ns=""http://www.example.com/SLI>""", attributes " ns:foo=""1"" bar=""0""", content { lf, " &TRUE;", lf, " ", lf, " " } } The following AnyType value is also an acceptable representation of the content of the element: { context "xmlns:ns=""http://www.example.com/SLI>""", Legg & Prager Expires 19 June 2004 [Page 4] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 attributes "bar=""0"" ns:foo=""1""", content { lf, " true", lf, " ", lf, " " } } By itself the AnyType ASN.1 type imposes no datatype restriction on the markup contained by its values, and is therefore analogous to the XML Schema anyType [XSD1]. There is no ASN.1 notation that can directly impose the constraint that a value of the AnyType type must conform to the markup allowed by a specific non-ASN.1 definition. However, UserDefinedConstraint notation can be exploited to provide parameters to nominated predefined constraints that have the desired effect. A predefined constraint is identified by an OBJECT IDENTIFIER value passed as a parameter in a UserDefinedConstraint. Though the UserDefinedConstraint notation does not express the semantics of a constraint, multi-schema aware ASN.1 tools can recognize particular OBJECT IDENTIFIER values (defined later in this document) and behave appropriately. These OBJECT IDENTIFIER values have id-constraint as a common prefix. id-constraint OBJECT IDENTIFIER ::= { iso(1) 2 36 79672281 xed(3) constraint(1) } 4. Supporting ASN.1 Types The section defines ASN.1 types that support the application of constraints on the markup allowed in values of the AnyType ASN.1 type. 4.1. The AnyURI Type A value of the AnyURI ASN.1 type is a URI character string [URI]. AnyURI ::= UTF8String (CONSTRAINED BY { -- conforms to the format of a URI -- }) 4.2. The NCName Type A value of the NCName ASN.1 type is a character string conforming to the NCName production of Namespaces in XML [XMLNS]. NCName ::= UTF8String (CONSTRAINED BY { -- conforms to the NCName production of -- Namespaces in XML -- }) Legg & Prager Expires 19 June 2004 [Page 5] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 5. Referencing Foreign Types To incorporate a non-ASN.1 datatype into an ASN.1 specification it is necessary to constraint values of the AnyType ASN.1 type to contain only markup valid with respect to that datatype. XML Schema and RELAX NG both have distinct definitional forms for elements and types (named patterns in RELAX NG). A DTD element type declaration can be regarded as defining either a complete element, or the content of an element (i.e., a type). The values of the AnyType ASN.1 type can be restricted to conform to a specific XML Schema named type or RELAX NG named pattern, or to conform to the content specified by a nominated DTD element type declaration, by applying a UserDefinedConstraint containing the value of id-constraint-xml-type as a parameter. id-constraint-xml-type OBJECT IDENTIFIER ::= { id-constraint 0 } A UserDefinedConstraint in which an OBJECT IDENTIFIER with the value of id-constraint-xml-type is used MUST satisfy all of the following conditions: a) there SHALL be three or four UserDefinedConstraintParameters, b) the first UserDefinedConstraintParameter SHALL be a Value of the OBJECT IDENTIFIER ASN.1 type and that Value SHALL be the same as id-constraint-xml-type, c) the second UserDefinedConstraintParameter SHALL be a Value of the AnyURI ASN.1 type (possibly an empty string), d) the third UserDefinedConstraintParameter SHALL be a Value of the NCName ASN.1 type, e) the fourth UserDefinedConstraintParameter, if present, SHALL be a Value of the AnyURI ASN.1 type, f) taken together the second and third UserDefinedConstraintParameter SHALL be the namespace name and local name [XMLNS] of either an XML Schema type definition, a RELAX NG named pattern, or a DTD element type declaration. The fourth UserDefinedConstraintParameter is used when the namespace name and local name reference is ambiguous, i.e., refers to definitions in more than one schema document. This situation would occur, for example, when importing types with the same name from independently developed XML Schemas defined without a target Legg & Prager Expires 19 June 2004 [Page 6] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 namespace. The value of the fourth UserDefinedConstraintParameter is a URI that indicates the intended schema document, either an XML Schema specification, a RELAX NG specification, or a DTD. Example AnyType (CONSTRAINED BY { OBJECT IDENTIFIER: { iso(1) 2 36 79672281 xed(3) constraint(1) 0 }, AnyURI:"http://www.w3.org/2001/XMLSchema", NCName:"decimal" }) The XML-Type and XML-Type-From-Schema parameterized types [X683] are defined so that XML Schema named types, RELAX NG named patterns and DTD element type declarations can be more conveniently referenced. XML-Type { AnyURI:namespace, NCName:name } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-type, AnyURI:namespace, NCName:name }) XML-Type-From-Schema { AnyURI:namespace, NCName:name, AnyURI:schemaIdentity } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-type, AnyURI:namespace, NCName:name, AnyURI:schemaIdentity }) For example, the following notation is sufficient to incorporate the xsd:decimal XML Schema type as the member type in a SEQUENCE OF type definition: SEQUENCE OF number XML-Type { "http://www.w3.org/2001/XMLSchema", "decimal" } Note that the ASN.1 Schema [ASD] translation of this ASN.1 type provides a more natural way to reference the XML Schema decimal type: The XML-Type parameterized type cannot be used if the URI of a schema document is required to disambiguate the namespace name and local name. 6. Referencing Foreign Elements ASN.1 does not have a construct analogous to a global element Legg & Prager Expires 19 June 2004 [Page 7] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 definition, hence there is no analogy in ASN.1 for referencing a global element definition (though there is in ASN.1 Schema). The AnyType ASN.1 type represents the content of an element. To import an element from a non-ASN.1 specification it is necessary to regard that element as the child element of a notional type whose content model permits only the imported element. The notional type is arbitrarily chosen to be a choice type. The notional type does not have any attributes therefore the attributes component of a value of AnyType would normally be empty, or contain only namespace declaration attributes. The values of the AnyType ASN.1 type can be restricted to conform to a notional choice type containing a specific XML Schema element or RELAX NG element, or containing an element with the name and content specified by a nominated DTD element type declaration, by applying a UserDefinedConstraint containing the value of id-constraint-xml-element as a parameter. id-constraint-xml-element OBJECT IDENTIFIER ::= { id-constraint 1 } A UserDefinedConstraint in which an OBJECT IDENTIFIER with the value of id-constraint-xml-element is used MUST satisfy all of the following conditions: a) there SHALL be three or four UserDefinedConstraintParameters, b) the first UserDefinedConstraintParameter SHALL be a Value of the OBJECT IDENTIFIER ASN.1 type and that Value SHALL be the same as id-constraint-xml-element, c) the second UserDefinedConstraintParameter SHALL be a Value of the AnyURI ASN.1 type (possibly an empty string), d) the third UserDefinedConstraintParameter SHALL be a Value of the NCName ASN.1 type, e) the fourth UserDefinedConstraintParameter, if present, SHALL be a Value of the AnyURI ASN.1 type, f) taken together the second and third UserDefinedConstraintParameter SHALL be the namespace name and local name [XMLNS] of either an XML Schema element definition, a RELAX NG element definition, or a DTD element type declaration. The fourth UserDefinedConstraintParameter is used when the namespace Legg & Prager Expires 19 June 2004 [Page 8] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 name and local name reference is ambiguous. Its value is a URI that indicates the intended schema document, either an XML Schema specification, a RELAX NG specification, or a DTD. Example AnyType (CONSTRAINED BY { OBJECT IDENTIFIER: { iso(1) 2 36 79672281 xed(3) constraint(1) 1 }, AnyURI:"http://www.example.com/IPO", NCName:"purchaseOrder" }) The Contained-XML-Element and Contained-XML-Element-From-Schema parameterized types are defined so that XML Schema global elements, RELAX NG elements and DTD element type declarations can be more conveniently referenced. Contained-XML-Element { AnyURI:namespace, NCName:name } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-element, AnyURI:namespace, NCName:name }) Contained-XML-Element-From-Schema { AnyURI:namespace, NCName:name, AnyURI:schemaIdentity } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-element, AnyURI:namespace, NCName:name, AnyURI:schemaIdentity }) The Contained-XML-Element type cannot be used if the URI of a schema document is required to disambiguate the target namespace and name. 7. Security Considerations Values of the AnyType type potentially hold the content of elements for which the Canonical XML [CXML] representation must be recoverable. Such recovery is needed for the verification of digital signatures. The rules governing the representation of the content of an element in an AnyType value are compatible with Canonical XML. Implementors must be careful not to introduce any further changes which would make it impossible to recover the Canonical XML representation. 8. Acknowledgements This document and the technology it describes are a product of a joint research project between Adacel Technologies Limited and Deakin University on leveraging existing directory technology to produce an XML-based directory service. Legg & Prager Expires 19 June 2004 [Page 9] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 9. References 9.1. Normative References [BCP14] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998. [RXER] Legg, S. and D. Prager, "Robust XML Encoding Rules for ASN.1 Types", draft-legg-xed-rxer-xx.txt, a work in progress, December 2003. [X680] ITU-T Recommendation X.680 (07/02) | ISO/IEC 8824-1:2002, Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation [X683] ITU-T Recommendation X.683 (07/02) | ISO/IEC 8824-4:2002, Information technology - Abstract Syntax Notation One (ASN.1): Parameterization of ASN.1 specifications [XML] Bray, T., Paoli, J., Sperberg-McQueen, M. and E. Maler, "Extensible Markup Language (XML) 1.0 (Second Edition)", W3C Recommendation, http://www.w3.org/TR/2000/REC-xml-20001006, October 2000. [XMLNS] Bray, T., Hollander, D. and A. Layman, "Namespaces in XML", http://www.w3.org/TR/1999/REC-xml-names-19990114, January 1999. [ISET] Cowan, J. and R. Tobin, "XML Information Set", W3C Recommendation, http://www.w3.org/TR/2001/REC-xml- infoset-20011024, October 2001. [CXML] Boyer, J., "Canonical XML Version 1.0", W3C Recommendation, http://www.w3.org/TR/2001/REC-xml-c14n-20010315, March 2001. [XSD1] Thompson, H., Beech, D., Maloney, M. and N. Mendelsohn, "XML Schema Part 1: Structures", W3C Recommendation, http://www.w3.org/TR/2001/REC-xmlschema-1-20010502, May 2001. [RNG] Clark, J. and M. Makoto, "RELAX NG Tutorial", OASIS Committee Specification, http://www.oasis- open.org/committees/relax-ng/tutorial-20011203.html, December 2001. Legg & Prager Expires 19 June 2004 [Page 10] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 9.2. Informative References [ASD] Legg, S. and D. Prager, "ASN.1 Schema: An XML Representation for ASN.1 Specifications", draft-legg-xed-asd-xx.txt, a work in progress, December 2003. 10. Intellectual Property Notice The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director. 11. Authors' Addresses Dr. Steven Legg Adacel Technologies Ltd. 250 Bay Street Brighton, Victoria 3186 AUSTRALIA Phone: +61 3 8530 7710 Fax: +61 3 8530 7888 EMail: steven.legg@adacel.com.au Dr. Daniel Prager C/o Professor Lynn Batten Department of Computing and Mathematics Deakin University Geelong, Victoria 3217 AUSTRALIA EMail: dan@layabout.net Legg & Prager Expires 19 June 2004 [Page 11] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 EMail: lmbatten@deakin.edu.au Appendix A. ASN.1 for Schema Language Integration This appendix is normative. SchemaLanguageIntegration {iso(1) 2 36 79672281 xed(3) module(0) sli(1)} -- Copyright (C) The Internet Society (2003). This version of -- this ASN.1 module is part of RFC XXXX; see the RFC itself -- for full legal notices. DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN -- The non-parameterized types exported by this module belong -- to the namespace http://xmled.info/ns/ASN.1/0702/00 . EXPORTS AnyType, AnyURI, NCName, XML-Type{}, XML-Type-From-Schema{}, Contained-XML-Element{}; AnyType ::= SEQUENCE { prolog [0] UTF8String (SIZE(1..MAX)) OPTIONAL, context [1] UTF8String (SIZE(1..MAX)) OPTIONAL, attributes [2] UTF8String (SIZE(1..MAX)) OPTIONAL, content [3] UTF8String (SIZE(1..MAX)) OPTIONAL } AnyURI ::= UTF8String (CONSTRAINED BY { -- conforms to the format of a URI -- }) NCName ::= UTF8String (CONSTRAINED BY { -- conforms to the NCName production of -- Namespaces in XML -- }) id-constraint OBJECT IDENTIFIER ::= { iso(1) 2 36 79672281 xed(3) constraint(1) } id-constraint-xml-type OBJECT IDENTIFIER ::= { id-constraint 0 } id-constraint-xml-element OBJECT IDENTIFIER ::= { id-constraint 1 } XML-Type { AnyURI:namespace, NCName:name } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-type, AnyURI:namespace, NCName:name }) XML-Type-From-Schema { AnyURI:namespace, NCName:name, Legg & Prager Expires 19 June 2004 [Page 12] INTERNET-DRAFT XED: Schema Language Integration December 19, 2003 AnyURI:schemaIdentity } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-type, AnyURI:namespace, NCName:name, AnyURI:schemaIdentity }) Contained-XML-Element { AnyURI:namespace, NCName:name } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-element, AnyURI:namespace, NCName:name }) Contained-XML-Element-From-Schema { AnyURI:namespace, NCName:name, AnyURI:schemaIdentity } ::= AnyType (CONSTRAINED BY { OBJECT IDENTIFIER:id-constraint-xml-element, AnyURI:namespace, NCName:name, AnyURI:schemaIdentity }) END Full Copyright Statement Copyright (C) The Internet Society (2003). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Changes in Draft 01 The Directory XML Encoding Rules (DXER) have been renamed to the Robust XML Encoding Rules (RXER). Legg & Prager Expires 19 June 2004 [Page 13]