Skip Headers

# Mapping to a Simple Text Node

Previous

Next

Given the XML schema in Example: Schema for XML Direct Mapping to Simple Text Node, Figure: XML Direct Mapping to Simple Text Node illustrates an XML direct mapping to a simple text node in a corresponding XML document. Example: Java for XML Direct Mapping to Simple Text Node shows how to configure this mapping in Java.

Schema for XML Direct Mapping to Simple Text Node

    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="phone-number" type="xsd:string"/>
    </xsd:schema>

XML Direct Mapping to Simple Text Node

Description of "XML Direct Mapping to Simple Text Node"

Java for XML Direct Mapping to Simple Text Node

    XMLDirectMapping numberMapping = new XMLDirectMapping();
    numberMapping.setAttributeName("number");
    numberMapping.setXPath("text()");