Mapping issues

Viewing 1 reply thread
  • Author
    Posts
    • #12297

      Hi,

      I have a source xml message which looks something like this

      <doc>
      <docid>1</docid>
      <docdate>11/15/2005</docdate>
      </doc>
      <doc>
      <docid>2</docid>
      <docdate>11/13/2005</docdate>
      </doc>
      <doc>
      <docid>1</docid>
      <docdate>11/20/2005</docdate>
      </doc>

      I have to map this to outgoing schema which is something like this

      <doc>
      <docdate></docdate>
      </doc>

      The element docdate should have the minimum of all the dates in the incoming message. The number of times the doc element appears can be zero to unbounded, whereas the occurance of docdate in destination schema is only once

      how do I handle this is map? Thanks in advance

    • #12298

      I think you can do this with an XSLT template. I think you could have selection criteria to select the lowest date. At worst, you would need to loop over them all and just find the lowest manually.

      I do not know the XSLT off hand, but w3school.com is always a great place to start.

      You could also probably do it using the loping Functoid and a custom script Functoid to loop over each value. Then, set a variable to the lowest value. This would probably work best if you have some other top level node over top of this like <root><doc>.

      Hope this helps.

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