Customer Portal

How to pass souce field to output port in XML reader?

Comments 4

  • Avatar
    imriskal
    0
    Comment actions Permalink
    Hi Bongki,

    ID is not a part of XML so you can not use it in XPath expressions in your mapping. You have basically two options:

    A) The proper way is to use CloverETL Server with ExecuteGraph, pass the ID to the child graph as a parameter and fill the field ID with this parameter within the child graph.
    B) You can use also CloverETL Designer but you have to work with the XML file as you would work with a common string. However, this solution is not recommended because it is basically unable to react to any possible errors in the xml file. You can split the string by the root element and add a new attribute ID to the root element, for example <movies id="1">. Then you can use the attribute in your mapping. Please see my example.
    xmlreader.zip
    Regards,
  • Avatar
    bongki.jeong
    0
    Comment actions Permalink
    Hi,

    I really appreciate for your help,

    Your graph is a good idea, and I tested XML extract instead of XML reader.

    XML Extract component can pass the non-XML field.

    Thank you,

    Bongki.
  • Avatar
    imriskal
    0
    Comment actions Permalink
    Good point, XMLExtract is of course even better. I am sorry for not bringing it up earlier. I thought you have a reason for using XMLReader so I did not even consider the other components. My bad.

    Regards,
  • Avatar
    bongki.jeong
    0
    Comment actions Permalink
    Thank you very much for your warm advice,

    Best Regards,

    Bongki.

Please sign in to leave a comment.