XML data binding: Difference between revisions

Content deleted Content added
m for consistency, clarify "unmarshalling" also as "deserialization" and remove "un/serialization" -- these words were/are used interchangeably again later
Bender the Bot (talk | contribs)
 
(8 intermediate revisions by 6 users not shown)
Line 1:
{{unreferencedone source|date=June 2015}}
'''XML data binding''' refers to a means of representing information in an [[XML]] document as a [[business object]] in computer memory. This allows [[Application software|applications]] to access the data in the XML from the object, rather than using the [[Document Object Model|DOM]] or [[Simple API for XML|SAX]] to retrieve the data from a direct representation of the XML itself.
 
It makes it possible to read and write [[XML]] data using a programming language class library (e.g. [[C++]], [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]]), specifically created for a given XML data format.<ref>[https://www.liquid-technologies.com/xml-data-binder/what-is-xml-data-binding-part-1 "What is XML Data Binding - Tutorial"] Liquid Technologies. Retrieved 2024-07-24.</ref> Whilst it is possible to manually write a computer program to achieve this, '''XML data binding''' tools generate the source code to perform these tasks.
 
==Description==
Line 21 ⟶ 23:
==Alternatives==
 
An alternative approach to automatic data binding relies instead on hand-crafted [[XPath]] expressions that extract data from XML. This approach has some benefits, but also has some drawbacks. First, the approach 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. 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 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, which is time -consuming, potentially error -prone, and hampers application maintenance when XML schemas and XML content models are updated. Another drawback is the lack of XML schema verification, which XML data bindings typically apply automatically during unmarshalling. Schema validity is typically required in secure applications.
 
==Data binding in general==
One of XML data binding's strengths is the ability to [[serialization|deserialize]] objects across programs, languages, and platforms.<ref>[https://www.ibm.com/docs/en/odm/8.12.0?topic=binding-what-is-xml "What is XML binding"] IBM. Retrieved 2024-04-16.</ref> You can dump a time series of structured objects from a datalogger written in [[C (programming language)]] on an embedded processor, bring it across the network to process in [[Perl]] and finally visualize in [[GNU Octave|Octave]]. 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.
 
==XML data binding frameworks==
Line 42 ⟶ 44:
| Java
| {{free|[[Apache License|Apache]]}}
| {{releasestart date|2003|01|28}}
| 0.8
| {{unk}}
Line 52 ⟶ 54:
| {{free|[[Apache License 2.0]]}}
|
| 5.1.1, {{releasestart date|2022|08|29}}
| {{yes}}
| {{unk}}
Line 61 ⟶ 63:
| {{free|[[Apache License|Apache 2.0]]}}
|
| 1.4.1, {{releasestart date|2016|05|15}}
| {{unk}}
| {{unk}}
Line 70 ⟶ 72:
| {{GPL-lic}} and proprietary
|
| 4.0.0, {{releasestart date|2014|07|22}}
| {{unk}}
| {{unk}}
Line 79 ⟶ 81:
| {{GPL-lic}} and proprietary
| {{Start date and age|2000|12|08}}
| 2.8.131, {{releasestart date|2023|09|23}}
| {{yes}}
| {{yes}}
Line 97 ⟶ 99:
| {{free|[[BSD License]]}}
|
| 1.2.6, {{releasestart date|2015|01|01}}
| {{yes}}
| {{yes}}
| Maps classes to XML schemas via bytecode manipulation
|-
|[[Liquid XML Studio|Liquid XML Data Binder]]
| [http://simple.sourceforge.net/ Simple]
|C++, C#, Java, Visual Basic.Net, Visual Basic 6 (COM)
|Freeware and proprietry
|{{Start date and age|2001|6|1}}
|{{Start date and age|2024|06|18}}
|{{Yes}}
|{{Yes}}
|Supports XML schema (XSD), DTD, XDR, WSDL. Serializes XML to JSON and JSON to XML.
|-
|[[Liquid XML Studio|Liquid XML Objects]]
|C# and Visual Basic .Net (Supports XSD 1.1)
|Freeware and proprietry
|{{Start date and age|2019|03|03}}
|{{Start date and age|2024|06|18}}
|{{Yes}}
|{{Yes}}
|Direct replacement for XSD.exe. Integrated within [[Visual Studio|Microsoft Visual Studio]]. Supports XML schema (XSD 1.0 and XSD 1.1), DTD, WSDL. Serializes XML to JSON and JSON to XML.
|-
| [httphttps://simple.sourceforge.net/ Simple]
| Java
| {{free|[[Apache License|Apache 2.0]]}}
|
| 2.7.1, {{releasestart date|2017|02|09}}
| {{no}}
| {{yes}}
Line 124 ⟶ 144:
| {{free|[[Apache License|Apache 2.0]]}}
|
| 0.9.1, {{releasestart date|2008|04|01}}
| {{unk}}
| {{unk}}
Line 133 ⟶ 153:
| {{free|[[BSD license|BSD]]-style license}}
| {{Start date and age|2004|01|01}}
| 1.4.10, {{releasestart date|2017|05|23}}
| {{unk}}
| {{unk}}
| Also capable of serializing to JSON
|-
| [http://zeus.ow2.org/ Zeus] {{Webarchive|url=https://web.archive.org/web/20190128101400/http://zeus.ow2.org/ |date=2019-01-28 }}
| Java
| ?
|
| 3.5 beta, {{releasestart date|2002|08|16}}
| {{unk}}
| {{unk}}