Skip Headers

# Mapping to a Simple Sequence

Previous

Next

Given the XML schema in Example: Schema for Composite Direct Collection XML Mapping to a Simple Sequence, Figure: Composite Direct Collection XML Mapping to a Simple Sequence illustrates a composite direct collection XML mapping to a simple sequence of text nodes in a corresponding XML document. Example: Java for Composite Direct Collection XML Mapping to a Simple Sequence shows how to configure this mapping in Java.

Schema for Composite Direct Collection XML Mapping to a Simple Sequence

    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="employee" type="employee-type"/>
        <xsd:complexType name="employee-type">
            <xsd:sequence>
                <xsd:element name="task" type="xsd:string" maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:schema>

Composite Direct Collection XML Mapping to a Simple Sequence

Description of "Composite Direct Collection XML Mapping to a Simple Sequence"

Java for Composite Direct Collection XML Mapping to a Simple Sequence

    XMLCompositeDirectCollectionMapping tasksMapping = new XMLCompositeDirectCollectionMapping();
    tasksMapping.setAttributeName("tasks");
    tasksMapping.setXPath("task/text()");