Map based of condition

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Map based of condition

Viewing 1 reply thread
  • Author
    Posts
    • #24688

      HI friends,

       

      i have a input xml document with some nodes. One of it is “Description”.

      i need to map this to some other xml document which contains some other nodes.

      for some nodes i have made one to one mapping.

      but for other nodes in target document i need to map based on condition that,

      if “Description” element in input document is equal to “store” it needs to be mappded to “Storage” element in the target document.

      if Description is equal to “Grossary” it needs to be mappded to “GrossaryStore” element in the target

      document.

      .

      .

      .

      .

       

      like wise i need to map the “Description” element based on its content to corresponding element in the target document. i.e few elements in the target document depend on content of “Description” element. All these dependent elements are min occurs 0.

      i can take a scriping functiod for each condition and assign it.

      but suppose if i have to check for 20 elements, then i end up adding 20 scripting functiods.

      i am not good at xslt.

      is there any way we can assing values with xslt in my requirement?

       

       

    • #24690

      You want to create a green logical [=] for each evaluation of description. 

      You can then use a purple conditional mapper[->]. If you logical evaluation for “Description = something” returns true, the conditional mapping functiod will allow the mapping through, otherwise, in the case of false, it will suppress the output to that node.

      For compound conditions, use the logical [&] to join the logical conditions and use the & output as input to the conditional mapper.

      By the way: Conditional mapper needs to have the logical parameter first, and data parameter second, or it will fail.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.