No announcement yet.

Insert XML values

  • Filter
  • Time
  • Show
Clear All
new posts

  • Insert XML values

    <City.Name>New York</City.Name>

    The message gets batched at the <City> level. I need to copy
    <City.Name>New York</City.Name>

    into the rest of the XML body, and place it right after </Bed>. The value of the city will be dynamic, as it differes on each message.

    I've tried making a outbound template such as below but does not seem to work:

    tmp['City']['City.Name'] = msg['City']['City.Name'].toString();

    Also tried mapping values from <city></city> but it seems to copy the literal value of the map.

    Any ideas would be appreciated.
    Last edited by gojoshi; 10-02-2019, 04:47 AM.

  • #2
    Not sure if this will always work depending on what your real messages look like, but for this example, you can do:

    Code: += msg.City


    • #3
      Thank You agermano, that does work.


      • #4
        If you have no Bed child nodes of house this will append City as the last child node of house.

        If you have more than one Bed child node of house this could potentially reorder child nodes of house (all Bed nodes will be grouped together, a copy of msg.City will be appended, any nodes between your Bed nodes will be moved down after the msg.City copy.)

        If you have no house node this will create one.

        If you have more than one house node it will throw an exception.