Mapping an Optional Element w/ Required Attribute to an Optional Element

Home Page Forums BizTalk 2004 – BizTalk 2010 Mapping an Optional Element w/ Required Attribute to an Optional Element

Viewing 1 reply thread
  • Author
    Posts
    • #21508

      This is probably easy but I’m new at this.

      So I’m mapping Schema A to Schema B.  Schema A has an optional element with a required attribute.  I’m trying to map that attribute to an optional element in Schema B.  My problem is that the element in Schema B shows up even if the element in Schema A is not present. 

      In the output xsl I’m getting

      <ns0:BNode><xsl:value-of select=”s0:Root/s0:ANode/@att /> </ns0:BNode>

      I want

      <xsl:if test=”s0:Root/s0:ANode”><ns0:BNode><xsl:value-of select=”s0:Root/s0:ANode/@att /> </ns0:BNode></xsl:if>

      Anyone know the best way to do this?

    • #21509

      Just insert a Loop functoid or a Logical Existence functoid between ANode and BNode in addition to the value link between @att and BNode. That should do it. Test both and compare the xslt, doing that, I’d pick the loop.

       

      //Niklas Häggström – Connecta AB

      • #21510

        Thanks, the loop worked just fine.  I was hoping it was something simple I was missing.

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