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

ConvertBody - Mediation

author
Talend Documentation Team
EnrichVersion
6.4
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
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)
EnrichPlatform
Talend Studio

This scenario applies only to Talend Open Studio for ESB, Talend Data Services 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>