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 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 fail to preserve all the information in an XML document. Specifically, information like comments, XML entity references, and sibling order will fail to be preserved in the object representation created by the binding application. This is not necessarily true; sufficiently complex data binders are capable of preserving 100% of the information in an XML document.
O/RM frameworks and tools
Java
- Hydrate [1], open source, relational/object/XML mapping tool
- Castor [2], open source, object/XML/relational mapping tool
.Net
- Integrated into the language via the .Net attributes: System.Xml.Serialization.XmlRootAttribute and System.Xml.Serialization.XmlElementAttribute
C++
- xsd [3], open source data binding tool that uses W3C XML Schema as a schema language, also provides an event-driven, SAX-like mapping
External link
- XML Data Binding Resources, by Ronald Bourret
- XML Data-Binding: Comparing Castor to .NET, by Niel Bornstein