locked
BizTalk 2010 - map schema with repeating sequences and repeating sub-sequences depending on value in 1 sub-sequence RRS feed

  • Question

  • Hello,

    I am facing this problem:

    I have a schema with repeating sequences and repeating sub-sequences, that my or may not be available.

    I have to map values from multiple sub-squences (when available) from record where 1 sub-sequence has specific value. In this case <type> of <produkt> should be "W".

    My source looks like this:

    <objecten>
      <object>
        <objectID>
          ID1
        </objectID>
          <produkt>
            <type>
              E
            </type>
            <text>
              electricity1
            </text>
          </produkt>
          <produkt>
            <type>
              G
            </type>
            <text>
              gas1
            </text>
          </produkt>
      </object>
      <object>
        <objectID>
          ID2
        </objectID>
          <produkt>
            <type>
              E
            </type>
            <text>
              electricity2
            </text>
          </produkt>
          <produkt>
            <type>
              G
            </type>
            <text>
              gas2
            </text>
          </produkt>
          <produkt>
            <type>
              W
            </type>
            <text>
              water2
            </text>
          </produkt>
      </object>
      <object>
        <objectID>
          ID3
        </objectID>
          <produkt>
            <type>
              E
            </type>
            <text>
              electricity3
            </text>
          </produkt>
          <produkt>
            <type>
              G
            </type>
            <text>
              gas3
            </text>
          </produkt>
          <produkt>
            <type>
              W
             </type>
            <text>
              water3
            </text>
          </produkt>
      </object>
    < /objecten>

    My destination should, in this case, look like this:

    <object>
      <objectID>
          ID2
        </objectID>
      <Etype>
        electricity2
      </Etype>
      <Gtype>
        gas2
      </Gtype>
      <Wtype>
        water2
      </Wtype>
    < /object>

    Can someone point me in the right direction to archieve this?
    A sample of the solution will be appriciated.

    • Edited by Robbish Tuesday, April 7, 2015 11:56 AM
    Tuesday, April 7, 2015 9:36 AM

Answers

  • The Logical Functoids when mapped to a destination Record Element have the affect of xs:if around the entire destination node.

    Start my linking <type> to an Equal Function with the second parameter as W, then link the Equal Functoid to the target sequence you want to apperar/not appear depending on <type>.

    • Proposed as answer by Singh AK Wednesday, April 8, 2015 5:49 PM
    • Marked as answer by Angie Xu Monday, April 13, 2015 1:46 AM
    Tuesday, April 7, 2015 3:19 PM
    Moderator

All replies

  • The Logical Functoids when mapped to a destination Record Element have the affect of xs:if around the entire destination node.

    Start my linking <type> to an Equal Function with the second parameter as W, then link the Equal Functoid to the target sequence you want to apperar/not appear depending on <type>.

    • Proposed as answer by Singh AK Wednesday, April 8, 2015 5:49 PM
    • Marked as answer by Angie Xu Monday, April 13, 2015 1:46 AM
    Tuesday, April 7, 2015 3:19 PM
    Moderator
  • Seems not to work, maybe my question was not quite wat I ment it to be...
    I only want the information from the first Object (in this case ObjectID2) with an produkt of type W be mapped from source to destination. In that case I also need the information of produkt where type is E or G, in that sequense.

    Monday, April 13, 2015 6:39 AM