Jakarta XML Binding ( JAXB ; formerly Java Architecture for XML Binding ) is a software framework that allows Java EE developers to map Java classes to XML representations. JAXB provides two main features: the ability to marshal Java objects into XML and the inverse, i.e. to unmarshal XML back into Java objects. In other words, JAXB allows storing and retrieving data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program's class structure. It is similar to xsd.exe and XmlSerializer in the .NET Framework .
24-713: JAXB is particularly useful when the specification is complex and changing. In such a case, regularly changing the XML Schema definitions to keep them synchronised with the Java definitions can be time-consuming and error-prone. JAXB is one of the APIs in the Jakarta EE platform (formerly Java EE), part of the Java Web Services Development Pack (JWSDP), and one of the foundations for WSIT . It
48-1351: A W3C Recommendation in April 2012 , which means it is an approved W3C specification. Significant new features in XSD 1.1 are: Until the Proposed Recommendation draft, XSD 1.1 also proposed the addition of a new numeric data type, precisionDecimal. This proved controversial, and was therefore dropped from the specification at a late stage of development. W3C XML Schema 1.0 Specification W3C XML Schema 1.1 Specification Other MSXML Microsoft XML Core Services ( MSXML ) are set of services that allow applications written in JScript , VBScript , and Microsoft development tools to build Windows-native XML -based applications. It supports XML 1.0, DOM , SAX , an XSLT 1.0 processor, XML schema support including XSD and XDR , as well as other XML-related technologies. All MSXML products are similar in that they are exposed programmatically as OLE Automation (a subset of COM ) components. Developers can program against MSXML components from C , C++ or from Active Scripting languages such as JScript and VBScript. Managed .NET Interop with MSXML COM components
72-455: A " schemagen " tool that can essentially perform the inverse of " xjc ", creating an XML Schema from a set of annotated classes. The table below lists the mappings of XML Schema (XSD) data types to Java data types in JAXB. XML Schema (W3C) 1.0, Part 2 Datatypes (Recommendation) , 1.1, Part 1 Structures (Recommendation) , XSD ( XML Schema Definition ), a recommendation of
96-423: A collection of schema documents , which contain the source language definitions of these components. In popular usage, however, a schema document is often referred to as a schema. Schema documents are organized by namespace: all the named schema components belong to a target namespace, and the target namespace is a property of the schema document as a whole. A schema document may include other schema documents for
120-520: A complex type may be constrained by assertions— XPath 2.0 expressions evaluated against the content that must evaluate to true. After XML Schema-based validation, it is possible to express an XML document's structure and content in terms of the data model that was implicit during validation. The XML Schema data model includes: This collection of information is called the Post-Schema-Validation Infoset (PSVI). The PSVI gives
144-429: A schema are: Other more specialized components include annotations, assertions, notations, and the schema component which contains information about the schema as a whole. Simple types (also called data types) constrain the textual values that may appear in an element or attribute. This is one of the more significant ways in which XML Schema differs from DTDs. For example, an attribute might be constrained to hold only
168-468: A valid XML document its "type" and facilitates treating the document as an object, using object-oriented programming (OOP) paradigms. The primary reason for defining an XML schema is to formally describe an XML document; however the resulting schema has a number of other uses that go beyond simple validation. The schema can be used to generate code, referred to as XML Data Binding . This code allows contents of XML documents to be treated as objects within
192-465: A valid date or a decimal number. XSD provides a set of 19 primitive data types ( anyURI , base64Binary , boolean , date , dateTime , decimal , double , duration , float , hexBinary , gDay , gMonth , gMonthDay , gYear , gYearMonth , NOTATION , QName , string , and time ). It allows new data types to be constructed from these primitives by three mechanisms: Twenty-five derived types are defined within
216-554: A version number associated with them. For example, "Microsoft.XMLHTTP". These ProgIDs were first introduced in MSXML 1.0, however are currently mapped to MSXML 3.0 objects and the msxml3.dll. Different versions of MSXML support slightly different sets of functionality. For example, while MSXML 3.0 supports only XDR schemas, it does not support XSD schemas. MSXML 4.0, MSXML 5.0, and MSXML 6.0 support XSD schemas. However, MSXML 6.0 does not support XDR schemas. Support for XML Digital Signatures
240-618: Is not supported nor recommended. As with all COM components, an MSXML object is programmatically instantiated by CLSID or ProgID . Each version of MSXML exposes its own set of CLSID's and ProgIDs. For example, to create an MSXML 6.0 DOMDocument object, which exposes the IXmlDomDocument , IXmlDomDocument2 , and IXmlDomDocument3 COM interfaces, the ProgID "MSXML2.DOMDocument.6.0" must be used. MSXML also supports version-independent ProgIDs. Version-independent ProgIDs do not have
264-441: Is successful in that it has been widely adopted and largely achieves what it set out to, it has been the subject of a great deal of severe criticism, perhaps more so than any other W3C Recommendation. Good summaries of the criticisms are provided by James Clark, Anders Møller and Michael Schwartzbach, Rick Jelliffe and David Webber. General problems: Practical limitations of expressibility: Technical problems: XSD 1.1 became
SECTION 10
#1732790359227288-458: Is the name used in this article. In its appendix of references, the XSD specification acknowledges the influence of DTDs and other early XML schema efforts such as DDML , SOX , XML-Data, and XDR . It has adopted features from each of these proposals but is also a compromise among them. Of those languages, XDR and SOX continued to be used and supported for a while after XML Schema was published. A number of Microsoft products supported XDR until
312-614: The CDDL open source license at java.net . The tool " xjc " can be used to convert XML Schema and other schema file types (as of Java 1.6, RELAX NG , XML DTD , and WSDL are supported experimentally) to class representations. Classes are marked up using annotations from javax.xml.bind.annotation.* namespace, for example, @XmlRootElement and @XmlElement . XML list sequences are represented by attributes of type java.util.List . Marshallers and Unmarshallers are created through an instance of JAXBContext. In addition, JAXB includes
336-463: The W3C. Because of confusion between XML Schema as a specific W3C specification, and the use of the same term to describe schema languages in general, some parts of the user community referred to this language as WXS , an initialism for W3C XML Schema, while others referred to it as XSD , an initialism for XML Schema Definition. In Version 1.1 the W3C has chosen to adopt XSD as the preferred name, and that
360-586: The World Wide Web Consortium ( W3C ), specifies how to formally describe the elements in an Extensible Markup Language ( XML ) document. It can be used by programmers to verify each piece of item content in a document, to assure it adheres to the description of the element it is placed in. Like all XML schema languages , XSD can be used to express a set of rules to which an XML document must conform to be considered "valid" according to that schema. However, unlike most other schema languages, XSD
384-450: The client invoking validation to trust the document sufficiently to know that it is being validated against the correct schema. "xsi" is the conventional prefix for the namespace " http://www.w3.org/2001/XMLSchema-instance ".) XML Schema Documents usually have the filename extension ".xsd". A unique Internet Media Type is not yet registered for XSDs, so "application/xml" or "text/xml" should be used, as per RFC 3023. The main components of
408-451: The permitted content of an element, including its element and text children and its attributes. A complex type definition consists of a set of attribute uses and a content model. Varieties of content model include: A complex type can be derived from another complex type by restriction (disallowing some elements, attributes, or values that the base type permits) or by extension (allowing additional attributes and elements to appear). In XSD 1.1,
432-469: The programming environment. The schema can be used to generate human-readable documentation of an XML file structure; this is especially useful where the authors have made use of the annotation elements. No formal standard exists for documentation generation, but a number of tools are available, such as the Xs3p stylesheet, that will produce high-quality readable HTML and printed material. Although XML Schema
456-612: The release of MSXML 6.0 (which dropped XDR in favor of XML Schema) in December 2006. Commerce One , Inc. supported its SOX schema language until declaring bankruptcy in late 2004. The most obvious features offered in XSD that are not available in XML's native Document Type Definitions (DTDs) are namespace awareness and datatypes, that is, the ability to define element and attribute content as containing values such as integers and dates rather than arbitrary text. The XSD 1.0 specification
480-457: The same namespace, and may import schema documents for a different namespace. When an instance document is validated against a schema (a process known as assessment ), the schema to be used for validation can either be supplied as a parameter to the validation engine, or it can be referenced directly from the instance document using two special attributes, xsi:schemaLocation and xsi:noNamespaceSchemaLocation . (The latter mechanism requires
504-470: The specification itself, and further derived types can be defined by users in their own schemas. The mechanisms available for restricting data types include the ability to specify minimum and maximum values, regular expressions, constraints on the length of strings, and constraints on the number of digits in decimal values. XSD 1.1 again adds assertions, the ability to specify an arbitrary constraint by means of an XPath 2.0 expression. Complex types describe
SECTION 20
#1732790359227528-505: Was also designed with the intent that determination of a document's validity would produce a collection of information adhering to specific data types . Such a post-validation infoset can be useful in the development of XML document processing software. XML Schema , published as a W3C recommendation in May 2001, is one of several XML schema languages . It was the first separate schema language for XML to achieve Recommendation status by
552-530: Was also part of the Java SE platform (in version Java SE 6–10). As of Java SE 11, JAXB was removed. For details, see JEP 320 . JAXB 1.0 was released in 2003, having been developed under the Java Community Process as JSR 31. In 2006 JAXB 2.0 was released under JSR 222 and Maintenance Release 2 released in December 2009. Reference implementations for these specifications were available under
576-408: Was originally published in 2001, with a second edition following in 2004 to correct large numbers of errors. XSD 1.1 became a W3C Recommendation in April 2012 . Technically, a schema is an abstract collection of metadata, consisting of a set of schema components : chiefly element and attribute declarations and complex and simple type definitions. These components are usually created by processing
#226773