XML data binding

XML data binding

XML data binding refers to the process of representing the information in an XML document as an object in computer memory. This allows applications to access the data in the XML from the object rather than using the DOM to retrieve the data from a direct representation of the XML itself.

An XML data binder accomplishes this by automatically creating a mapping between elements of the XML schema of the document we wish to bind and members of a class to be represented in memory.

When this process is applied to convert an XML document to an object, it is called unmarshalling. The reverse process, to serialize an object as XML, is called marshalling.

Since XML is inherently sequential and objects are (usually) not, XML data binding mappings often have difficulty preserving all the information in an XML document. Specifically, information like comments, XML entity references, and sibling order may fail to be preserved in the object representation created by the binding application. This is not always the case; sufficiently complex data binders are capable of preserving 100% of the information in an XML document.

Similarly, since objects in computer memory are not inherently sequential, and may include links to other objects (including self-referential links), XML data binding mappings often have difficulty preserving all the information about an object when it is marshalled to XML.

An alternative approach to automatic data binding relies instead on manually hand-crafted XPath expressions that extract the data from XML. This approach has a number of benefits. First, the data binding code only needs proximate knowledge (e.g., topology, tag names, etc.) of the XML tree structure, which developers can determine by looking at the XML data; XML schemas are no longer mandatory. Furthermore, XPath allows the application to bind the relevant data items and filter out everything else, avoiding the unnecessary processing that would be required to completely unmarshall the entire XML document. The major drawback of this approach is the lack of automation in implementing the object model and XPath expressions. Instead the application developers have to create these artifacts manually.

Data binding in general

One of XML data binding's strengths is the ability to un/serialize objects across programs, languages, and platforms. You can dump a time series of structured objects from a datalogger written in C on an embedded processor, bring it across the network to process in perl and finally visualize in Mathematica. The structure and the data remain consistent and coherent throughout the journey, and no custom formats or parsing is required. This is not unique to XML. YAML, for example, is emerging as a powerful data binding alternative to XML. JSON (which can be regarded as a subset of YAML) is often suitable for lightweight or restricted applications.

Data binding frameworks and tools

Multi-Language

[http://www.liquid-technologies.com Liquid XML 2008] , advanced Wizard driven data binding tool for generating C++, C# .Net, Java, VB .Net and Visual Basic 6 components from XSD, XDR and DTD Schema files.

C++

* [http://gsoap2.sourceforge.net gSOAP] - Open source XML data binding compilers and autocoders for C and C++, supports SOAP, WSDL and XSD.
* CodeSynthesis XSD - Open source XML data binding compiler for C++ which provides an event-driven, SAX-like C++ mapping in addition to the standard, tree-like in-memory object model. For closed source use, the company also offers a commercial license.
* CodeSynthesis XSD/e - Open source, validating XML parser/serializer and C++ data binding generator for mobile and embedded systems.
* xmlbeansxx - A C++ library for easing the processing of XML data. It is very similar to and in fact was inspired by XMLBeans.

Delphi

* XmlDataBinding Standard CodeGear XML binding tool, included in Delphi product (from version 7 to 2007)

Java

* Schemaless Java-XML data binding with XPath and VTD-XML
*Java Architecture for XML Binding (JAXB), and JaxMe variation
*Eclipse Modeling Framework (EMF) open source (EPL), dynamic and static binding
*XMLBeans data binding over Document Object Model view of data
*Hibernate, open source (GNU LGPL), relational/object/XML mapping tool
*Castor, open source (original BSD), object/XML/relational mapping tool
*JiBX, open source (modified BSD), a high performance Java/XML binding framework
*CookXml, open source (MIT License), dynamically configurable XML binding tool.
*XStream, a simple Java library to serialize objects to XML and back again.

JavaScript

*OpenLaszlo, open source, JavaScript based, Rich Internet application programming language

.Net

*Integrated into the .NET Framework, in the System.Xml.Serialization namespace.

Python

*Amara open source Python library for XML data-binding

External links

* [http://www.rpbourret.com/xml/XMLDataBinding.htm XML Data Binding Resources] , by Ronald Bourret
* [http://www.w3.org/2002/ws/databinding XML Schema Patterns for Databinding Working Group]

ee also

* Bound control
* Data structure
* JSON
* Serialization
* YAML


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • XML data binding — Este artículo o sección necesita referencias que aparezcan en una publicación acreditada, como revistas especializadas, monografías, prensa diaria o páginas de Internet fidedignas. Puedes añadirlas así o avisar al autor principal del artículo en… …   Wikipedia Español

  • Data binding — is a general technique that binds two data/information sources together and maintains synchronization of data. This is usually done with two data/information sources with different types as in XML data binding. However, in UI data binding, data… …   Wikipedia

  • XML-Datenbindung — (englisch XML data binding) ist in der Objektorientierung der Prozess der Abbildung von XML Dokumenten auf Objekte bzw. die Repräsentation von XML Dokumenten durch Objekte und vice versa. Dieser Prozess erlaubt es Programmierern, auf XML Daten… …   Deutsch Wikipedia

  • Binding — bezeichnet: Binding Preis für Natur und Umweltschutz, liechtensteinischer Preis für Natur und Umweltschutz Sophie und Karl Binding Stiftung, gemeinnützige Stiftung in Basel/Schweiz Binding Waldpreis, Preis für nachhaltige Waldwirtschaft in der… …   Deutsch Wikipedia

  • XML — Infobox file format name = Extensible Markup Language icon = logo = extension = .xml mime = application/xml, text/xml (deprecated) type code = uniform type = public.xml magic = owner = World Wide Web Consortium genre = Markup language container… …   Wikipedia

  • Binding — Un binding (qui est un terme anglais désignant l action de lier des éléments entre eux) peut avoir plusieurs significations en informatique : binding de langage, qui permet l utilisation d une bibliothèque logicielle dans un autre langage de …   Wikipédia en Français

  • Binding (computer science) — In computer science, binding is the creation of a simple reference to something that is larger and more complicated and used frequently. The simple reference can be used instead of having to repeat the larger thing. A binding is such a… …   Wikipedia

  • XML Signature — (also called XMLDsig , XML DSig , XML Sig ) is a W3C recommendation that defines an XML syntax for digital signatures. Functionally, it has much in common with PKCS#7 but is more extensible and geared towards signing XML documents. It is used by… …   Wikipedia

  • .xml — Vorlage:Infobox Dateiformat/Wartung/magic fehltVorlage:Infobox Dateiformat/Wartung/website fehlt Extensible Markup Language Dateiendung .xml …   Deutsch Wikipedia

  • XML — Vorlage:Infobox Dateiformat/Wartung/magic fehltVorlage:Infobox Dateiformat/Wartung/website fehlt Extensible Markup Language Dateiendung …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”