IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Accessing XML Tag Names

    Posted 02/27/19 04:21 PM

    Originally posted by: Bragger


    Hi,

    I have 2 input cards in my WTX map. First card accepts XML file  and second card is a lookup file (pipe delimited). Now I want to compare each tag name that is present in Lookup file with the xml tag names that will come in Input file 1. Wherever there is a match I need to populate the corresponding value of that tag in Output.

    For e.g. - Let's say in input file 1 the tags are as below:

    <Name>Tom</Name>

    <Age>40</Age>

    <Gender>M</Gender>

    Look up file has below tags:

    1|<Name>

    2|<Age>

    So in Output I want "Tom" and "40" to be populated because those are the only those 2 tags present in look up file. I can-not hardcode anything because look up file can change on regular basis. Tomorrow they can update the tags as "<Age>" and "<Gender>" and so on..

    I tried to generate the type tree both in Classic and Xerces mode for input card 1 but I am not able to access the XML tag names like <Name>, <Age> etc. All I have access is the value of these tags. In Classic version I see that in type tree all the fields have initiator set with the tag names so don't know how to read the tag names from initiator. In Xerces mode the properties are defined as XML and still I can-not read them in map rule.

    Anybody knows how to access tag names from XML in my map rule?

     

     


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: Accessing XML Tag Names

    Posted 03/01/19 12:41 PM
      |   view attached

    Originally posted by: PaulBrett


    Did you mean something like this?

    Thank you.

    Paul

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)

    zip
    ChoicePopulate.zip   14 KB 1 version


  • 3.  Re: Accessing XML Tag Names

    Posted 03/07/19 12:42 PM

    Originally posted by: Bragger


    Thanks Paul! However I wanted everything to be dynamic instead of hardcoding. I was able to achieve by using XPATH in WTX. With XPATH I can search any tag with-in my input XML file.


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender