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

ConvertBody - Mediation

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

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