Stephen M Hansn (IBM) Mapping between DFDL 1.0 Infset and XML Data Mdel Status f This Dcument This wrking draft dcument prvides infrmatin t the OGF cmmunity n the Data Frmat Descriptin Language (DFDL) standard and its interperability with XDM. Distributin is unlimited Cpyright Ntice Cpyright Open Grid Frum, (2011). All Rights Reserved. Abstract This dcument defines the mapping frm DFDL 1.0 Infset t W3C XDM, and frm W3C XDM t DFDL 1.0 infset. dfdl-wg@gf.rg Page 1 f 16
Stephen M Hansn (IBM) Table f cntents Mapping between DFDL 1.0 Infset and XML Data Mdel... 1 1. Intrductin... 3 2. Dcument Nde... 4 2.1. DFDL Infset t XDM... 4 2.2. XDM t DFDL Infset... 4 3. Element Nde... 6 3.1. DFDL Infset t XDM... 6 3.2. XDM t DFDL Infset... 8 4. Text Nde... 10 4.1. DFDL Infset t XDM... 10 4.2. XDM t DFDL Infset... 10 5. Namespace Nde... 11 5.1. DFDL Infset t XDM... 11 5.2. XDM t DFDL Infset... 11 6. Authrs and Cntributrs... 12 7. Intellectual Prperty Statement... 13 8. Disclaimer... 14 9. Full Cpyright Ntice... 15 10. References... 16 dfdl-wg@gf.rg Page 2 f 16
Stephen M Hansn (IBM) 1. Intrductin The W3C XML Data Mdel [XDM] is the data mdel fr XPath 2.0, XSLT 2.0 and XQuery. This dcument defines the mapping frm DFDL 1.0 [DFDL] Infset t XDM, and frm XDM t DFDL 1.0 Infset. This enables XML tls that use XDM as a cannical data mdel t include DFDL prcessrs and thereby enable nn-xml data t appear as virtual XML data. Here is a UML class diagram f the DFDL Infset, reprduced frm the DFDL 1.0 specificatin. There are three kinds f cncrete DFDL infrmatin item, Dcument, SimpleElement and CmplexElement. There are seven kinds f Ndes in the XDM, but when mapping frm and t DFDL nly fur are used, Dcument Nde, Element Nde, Text Nde and Namespace Nde. When mapping t DFDL, the mapping fails and prduces n Infset if the XDM cntains anything that can nt be represented in the DFDL Infset. This includes, but is nt limited t, nde kinds ther than Dcument, Element, Text and Namespace, data types ther than thse supprted by DFDL, mre than ne Dcument nde, multiple children in a Dcument nde, a Text Nde that is a sibling f an Element Nde. The fllwing sectins define the mapping fr each kind f XDM nde. dfdl-wg@gf.rg Page 3 f 16
Stephen M Hansn (IBM) 2. Dcument Nde Dcument Ndes have the fllwing prperties: base-uri, pssibly empty. children, pssibly empty. unparsed-entities, pssibly empty. dcument-uri, pssibly empty. string-value typed-value Dcument infrmatin items have the fllwing prperties: [rt] [dfdlversin] [schema], pssibly empty 2.1. DFDL Infset t XDM A Dcument Nde is cnstructed fr a Dcument infrmatin item. Dcument Nde prperties are derived frm the Dcument infrmatin item as fllws. base-uri children Empty. The DFDL Infset des nt cntain dcument URIs. The sequence f exactly ne Element Nde cnstructed frm the Element infrmatin item fund in the [rt] prperty. unparsed-entities Empty. string-value typed-value dcument-uri The cncatenatin f the string-value prperties f all descendant Text Ndes. The value f string-value as xs:untypedatmic 1. Empty. The DFDL Infset set des nt cntain dcument URIs. 2.2. XDM t DFDL Infset A Dcument infrmatin item is cnstructed fr a Dcument Nde. Dcument infrmatin item prperties are derived frm the Dcument Nde as fllws. 1 One f five additinal types added by the XML Data Mdel, see [XDM]. dfdl-wg@gf.rg Page 4 f 16
Stephen M Hansn (IBM) [rt] [dfdlversin] [schema] The Element infrmatin item cnstructed frm the children prperty, which must be a single Element nde. The string dfdl-1.0. Empty. dfdl-wg@gf.rg Page 5 f 16
Stephen M Hansn (IBM) 3. Element Nde Element Ndes have the fllwing prperties: base-uri, pssibly empty. nde-name parent, pssibly empty type-name children, pssibly empty attributes, pssibly empty namespaces nilled string-value typed-value is-id is-idrefs SimpleElement infrmatin items have the fllwing prperties: [namespace] [name] [dcument] [parent], pssibly empty [children], has n value [datatype], being the name f a built-in XML Schema simple type [datavalue], pssibly special value nil [schema], pssibly empty CmplexElement infrmatin items have the fllwing prperties: [namespace] [name] [dcument] [parent], pssibly empty [children], pssibly empty [datatype], has n value [datavalue], has n value [schema], pssibly empty Nte that n value is distinct frm empty, the empty string r nil. It is used when a prperty has n meaning in the cntext f a CmplexElement r SimpleElement. 3.1. DFDL Infset t XDM An Element Nde is cnstructed fr each SimpleElement and CmplexElement infrmatin item. Element Nde prperties are derived frm the Element infrmatin item as fllws. Nte: SimpleElement [datavalue] values may cntain characters that are illegal in XML, fr example, DFDL strings can cntain the character cde 0 (zer) within them, but XML des nt allw this character cde in any XML cntent even if it is represented as a character entity. Nevertheless, a DFDL described string is mapped t an XDM string data value. base-uri nde-name Empty. The DFDL Infset des nt cntain nde URIs. dfdl-wg@gf.rg Page 6 f 16
Stephen M Hansn (IBM) parent type-name children attributes namespaces nilled string-value typed-value xs:qname cnstructed frm the [name] and [namespace] prperties. If [parent] prperty is empty, then the Dcument Nde, therwise the Element Nde that crrespnds t the value f [parent]. CmplexElement: xs:anytype. SimpleElement: xs:qname, the lcal name being the value f [datatype] and the namespace being http://www.w3.rg/2001/xmlschema". Optinally, if [schema] prperty is nt empty, an implementatin may use the value f [schema] (a Schema Cmpnent Designatr) t btain the actual type definitin frm the referenced element declaratin, and then use its name and namespace t set type-name. If s, then fr SimpleElement it becmes pssible fr the value f [datavalue] prperty t be invalid accrding t the type, in which case type-name must be set t xs:anysimpletype. CmplexElement: If [children] is empty, then the empty sequence, therwise the sequence f Element Ndes cnstructed frm the Element infrmatin items fund in [children]. SimpleElement: Optinally a Text Nde cnstructed frm [datavalue] prperty (see sectin 4) Empty sequence. If [namespace] prperty is nt empty, then a Namespace Nde cnstructed frm the value f [namespace] (see sectin 5), therwise the empty sequence. If [datavalue] prperty has special value nil, then true, therwise "false". CmplexElement: The cncatenatin f the string-value prperties f all descendant Text Ndes. SimpleElement: If the value f [datavalue] is special value nil, then the empty string, therwise the value f [datavalue] cnverted t its cannical lexical representatin. CmplexElement: The value f string-value as xs:untypedatmic. dfdl-wg@gf.rg Page 7 f 16
Stephen M Hansn (IBM) is-id is-idrefs SimpleElement: If the value f [datavalue] is special value nil, then the empty sequence, therwise the value f [datavalue]. Optinally, if type-name has been set frm the actual type definitin using [schema] prperty, then typed-value is set as fllws: CmplexElement: Undefined. SimpleElement: If the value f [datavalue] is special value nil, then the empty sequence, else if type-name is xs:anysimpletype, then string-value as xs:untypedatmic, therwise the value f [datavalue]. If typed-value is nt undefined, the relatinship between the type-name, typedvalue, and string-value prperties f an Element nde is cnsistent with XML Schema validatin. "false". "false". 3.2. XDM t DFDL Infset A SimpleElement r CmplexElement infrmatin item is cnstructed fr an Element Nde, depending n whether the type-name prperty designates a simple type r a cmplex type. Element infrmatin item prperties are derived frm the Element Nde as fllws. [namespace] [name] [dcument] [parent] [children] The namespace name part f the value f nde-name prperty. The lcal name part f the value f nde-name prperty. The Dcument infrmatin item cnstructed frm the Dcument Nde. If parent prperty is the Dcument Nde, then empty, therwise the Element infrmatin item crrespnding t the Element Nde that is the value f the parent prperty. CmplexElement: If children prperty is the empty sequence, then empty, therwise the sequence f Element infrmatin items cnstructed frm the Element Ndes fund in children. SimpleElement: Has n value. dfdl-wg@gf.rg Page 8 f 16
Stephen M Hansn (IBM) [datatype] [datavalue] [schema] CmplexElement: Has n value. SimpleElement: If type-name refers t a built-in simple type, the lcal name part f type-name, therwise the lcal name f the nearest ancestr built-in simple type t type-name. CmplexElement: Has n value. SimpleElement: If nilled is true, the special value nil, therwise the value f typedvalue prperty. Empty. dfdl-wg@gf.rg Page 9 f 16
Stephen M Hansn (IBM) 4. Text Nde Text Ndes have the fllwing prperties: cntent parent, pssibly empty. 4.1. DFDL Infset t XDM If the value f a SimpleElement infrmatin item [datavalue] prperty cnverted t its cannical string representatin is nt the empty string then a Text Nde must be cnstructed, therwise n Text Nde is cnstructed. Text Nde prperties are derived frm the SimpleElement infrmatin item as fllws. cntent parent The value f [datavalue] prperty cnverted t its cannical lexical representatin. The Element Nde cnstructed frm the SimpleElement infrmatin item. 4.2. XDM t DFDL Infset When a SimpleElement infrmatin item is cnstructed, a Text Nde is nt used. dfdl-wg@gf.rg Page 10 f 16
Stephen M Hansn (IBM) 5. Namespace Nde Namespace Ndes have the fllwing prperties: prefix, pssibly empty uri parent, pssibly empty. 5.1. DFDL Infset t XDM If a SimpleElement r CmplexElement infrmatin item [namespace] prperty is nt empty, then a Namespace Nde must be cnstructed, therwise n Namespace Nde is cnstructed. Namespace Nde prperties are derived frm the Element infrmatin item as fllws. prefix uri parent Empty. There are n prefixes fr namespaces in DFDL. The value f the [namespace] prperty. The Element Nde cnstructed frm the Element infrmatin item. 5.2. XDM t DFDL Infset When a SimpleElement r CmplexElement infrmatin item is cnstructed, a Namespace Nde is nt used. dfdl-wg@gf.rg Page 11 f 16
Stephen M Hansn (IBM) 6. Authrs and Cntributrs Stephen M. Hansn, IBM Sftware Grup, Hursley, Winchester,UK smh@uk.ibm.cm We greatly acknwledge the cntributins made t this dcument by the fllwing peple. Sandy Ga, IBM Sftware Grup, Markham, Ontari, Canada dfdl-wg@gf.rg Page 12 f 16
Stephen M Hansn (IBM) 7. Intellectual Prperty Statement The OGF takes n psitin regarding the validity r scpe f any intellectual prperty r ther rights that might be claimed t pertain t the implementatin r use f the technlgy described in this dcument r the extent t which any license under such rights might r might nt be available; neither des it represent that it has made any effrt t identify any such rights. Cpies f claims f rights made available fr publicatin and any assurances f licenses t be made available, r the result f an attempt made t btain a general license r permissin fr the use f such prprietary rights by implementers r users f this specificatin can be btained frm the OGF Secretariat. The OGF invites any interested party t bring t its attentin any cpyrights, patents r patent applicatins, r ther prprietary rights which may cver technlgy that may be required t practice this recmmendatin. Please address the infrmatin t the OGF Executive Directr. dfdl-wg@gf.rg Page 13 f 16
Stephen M Hansn (IBM) 8. Disclaimer This dcument and the infrmatin cntained herein is prvided n an As Is basis and the OGF disclaims all warranties, express r implied, including but nt limited t any warranty that the use f the infrmatin herein will nt infringe any rights r any implied warranties f merchantability r fitness fr a particular purpse. dfdl-wg@gf.rg Page 14 f 16
Stephen M Hansn (IBM) 9. Full Cpyright Ntice Cpyright (C) Open Grid Frum (2011). All Rights Reserved. This dcument and translatins f it may be cpied and furnished t thers, and derivative wrks that cmment n r therwise explain it r assist in its implementatin may be prepared, cpied, published and distributed, in whle r in part, withut restrictin f any kind, prvided that the abve cpyright ntice and this paragraph are included n all such cpies and derivative wrks. Hwever, this dcument itself may nt be mdified in any way, such as by remving the cpyright ntice r references t the OGF r ther rganizatins, except as needed fr the purpse f develping Grid Recmmendatins in which case the prcedures fr cpyrights defined in the OGF Dcument prcess must be fllwed, r as required t translate it int languages ther than English. The limited permissins granted abve are perpetual and will nt be revked by the OGF r its successrs r assignees. dfdl-wg@gf.rg Page 15 f 16
Stephen M Hansn (IBM) 10. References [XDM] XML Data Mdel http://www.w3.rg/tr/2010/rec-xpath-datamdel-20101214/ [DFDL] DFDL 1.0 http://www.gf.rg/dcuments/gfd.174.pdf/ dfdl-wg@gf.rg Page 16 f 16