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

ConvertBody (Mediation)

Version
Cloud
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Processing components (Mediation) > ConvertBody components (Mediation)
Data Quality and Preparation > Third-party systems > Processing components (Mediation) > ConvertBody components (Mediation)
Design and Development > Third-party systems > Processing components (Mediation) > ConvertBody components (Mediation)
Last publication date
2024-02-21

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>