Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

XSL Many to Singles

Stevo-6112Dec 2 2009 — edited Sep 3 2019
I am using jdeveloper transformations and need to get from INPUT to OUTPUT but can't seen to get the desired result:
----------- INPUT ---------------------------       ------------------- OUTPUT --------------
<Note type="INSPECTION_REQUIRED_FLAG">N</Note>      <INSPECTION_REQUIRED_FLAG>N</INSPECTION_REQUIRED_FLAG>
<Note type="RECEIPT_REQUIRED_FLAG">Y</Note>         <RECEIPT_REQUIRED_FLAG>Y</RECEIPT_REQUIRED_FLAG>
It seems like jdeveloper only allows single nodes inside the for-each so I for-each the <Note> twice, once for each output node and use an if or choose to match the type attribute. However this only populates one of the output nodes, usually the last one and sometimes it duplicates it.
<xsl:for-each select="/ns0:PurchaseOrderLine/ns0:Note">
  <xsl:if test='xp20:matches(/ns0:PurchaseOrderLine/ns0:Note/@type,"INSPECTION_REQUIRED_FLAG")'>
    <ESC:INSPECTION_REQUIRED_FLAG>
      <xsl:value-of select="/ns0:PurchaseOrderLine/ns0:Note"/>
      </ESC:INSPECTION_REQUIRED_FLAG>
  </xsl:if>
</xsl:for-each>

<xsl:for-each select="/ns0:PurchaseOrderLine/ns0:Note">
  <xsl:if test='xp20:matches(/ns0:PurchaseOrderLine/ns0:Note/@type,"RECEIPT_REQUIRED_FLAG")'>
    <ESC:RECEIPT_REQUIRED_FLAG>
      <xsl:value-of select="/ns0:PurchaseOrderLine/ns0:Note"/>
    </ESC:RECEIPT_REQUIRED_FLAG>
  </xsl:if>
</xsl:for-each>
Full paths removed for readability.

Thanks...
This post has been answered by PrazzyJay on Dec 3 2009
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 11 2010
Added on Dec 2 2009
4 comments
1,514 views