![]() |
![]() |
![]() |
![]() |
|
| XJ | |||
|
|
|||
|
|
Technical SummaryThe integration of XML into an object-oriented language requires the specification of how XML documents are represented in the language's value space, how the type system is extended to represent XML types, and what expressions are available to operate on the XML values. A common characteristic of previous proposals for the integration of XML is that each has defined its own type system for XML. At one extreme, JAXB, a tool for generating Java classes from an XML Schema, embeds XML types completely into the Java type system. Since the XML type system and the Java type system are dissimilar, JAXB is forced to make arbitrary decisions about the representation of XML types. For example, the Java type system cannot represent the ordering or the tagged union constraints of XML Schema. The design of a custom type system and expression syntax for XML in a programming language has two significant drawbacks:
The goal of the design of XJ is to be consistent with existing XML and Java specifications. The basis for the XJ type systems for XML values is XML Schema. The expression syntax and semantics for navigating XML values is consistent with the XPath specification. It is our contention that this consistency with existing standards is more intuitive and practical for a programmer. XJ integrates XML into Java by introducing a new subclass of java.lang.Object, com.ibm.xj.XMLObject that serves as the root class for all XML types. Each element and atomic type declaration in an XML Schema is mapped into an XML class that is a subclass of com.ibm.xj.XMLObject. XPath expressions can be applied to all subclasses of com.ibm.xj.XMLObject. Other than the hierarchy under com.ibm.xj.XMLObject, Java is mostly unchanged --- the only change is defining how XML primitive types may be coerced into Java primitive values and vice versa. To ensure consistency with external XML standards, XJ XML values have the following properties:
|
| About IBM | Privacy | Terms of Use | Contact |