Skip to main content

Converting the body of an XML file into an org.w3c.dom.Document.class

This scenario applies only to Talend ESB, Talend Data Services Platform, Talend MDM Platform, Talend Real Time Big Data Platform, and Talend Data Fabric.

For more technologies supported by Talend, see Talend Mediation Components.

In this scenario, a cConvertBodyTo component is used to convert the body of an XML file into an org.w3c.dom.Document.class. Then a cBean component imports the org.w3c.dom.Document class, checks its content and prints out the root element name and the content of each category element.

The XML file is as follows:

<bookstore>
    <bookshelf>
        <category>Cooking</category>
        <quantity>100</quantity>
    </bookshelf>
    <bookshelf>
        <category>Languages</category>
        <quantity>200</quantity>
    </bookshelf>
    <bookshelf>
        <category>Arts</category>
        <quantity>300</quantity>
    </bookshelf>
    <bookshelf>
        <category>Science</category>
        <quantity>400</quantity>
    </bookshelf>
</bookstore>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!