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...