By default, the result of parsing using the AbtXmlMappingParser is an instance of the class
AbtXmlMappedRootElement. Subordinate XML elements are represented as instances of
AbtXmlMappedElement. The API for these objects closely resembles the DOM API discussed previously. For XML elements that are mapped to domain objects, an
AbtXmlMappedElement also holds a reference to the object that it maps into.
AbtXmlMappingParser is a customized SAX parser that can be configured to handle a variety of parsing scenarios. When instantiating an
AbtXmlMappingParser, a deserialization configuration (
AbtXmlDeserializationConfiguration) can be provided to customize the behavior of the parser. For example, it may be necessary to use a custom SAX handler to process the contents of a particular element. A custom deserialization configuration enables this and various other customizations. The example below builds a deserialization configuration for parsing WSDL (Web Service Definition Language) documents. The example code can be executed if the Web services features is loaded.
The AbtXmlMappingParser is most useful when both a mapping specification and schema can be resolved. However, the parser will function in the absence of these artifacts. Below is a summary of the parser behavior when the various XML parsing inputs are resolvable.
For objects that are used only for representing XML data, it may practical to utilize instances of AbtXmlMappedElement to represent the object structure and support object protocol. Instances of
AbtXmlMappedElement can be treated like domain objects constructed dynamically from schema types. Get and set selectors for these
protocol objects are derived from the element and attributes of an XML schema type. When an element
mapping is present, the mapping can be used to specify the get and set selectors for the element.
The AbtXmlMappingParser must be able to resolve XML schemas and VA Smalltalk mapping specifications during parsing. These resources are retrieved from the XML object cache. By default, the global XML object cache is used to resolve required parsing resources; however, an alternative XML object cache can be specified in the deserialization configuration used by the parser.