on 09-28-2011 2:02 PM
Hi Friends
How can we skip a record based on a particular plant value with XSLT mapping.
check out the link http://www.w3schools.com/xsl/xsl_for_each.asp
you will have to use the not equal operation on that field you want to skip
Filtering the Output
We can also filter the output from the XML file by adding a criterion to the select attribute in the <xsl:for-each> element.
ex.
<xsl:for-each select="catalog/cd[artist='Bob Dylan']">
Legal filter operators are:
= (equal)
!= (not equal)
< less than
> greater than
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shabarish, great to find you answer , still in Wipro? remember we had a chat once.
My problem is for a plant value 3062 the record should be skipped , so how do we achieve it with XSLT , the output of thye xslt program will be fed into the message mapping right?I am working on XSLT for first time , maybe if you could help me a bit more.It is a file to idoc scenario , the file will be sending multiple records at a time.
refer this:
in addition to previous reply u can chk this option also
<xsl:for-each select="MT_Name/row">
< xsl: if test=u201Dplant != 3062u201D>
ur logic
</xsl:if>
</xsl:for-each>
this is the sample source file
<?xml version="1.0" encoding="UTF-8"?>
<CEVAStockMovement xmlns:ns0="urn:bp:xi:dwn:lu:warehouse3rd:Logistics:100">
<Header>
<TRANDATE>07052009</TRANDATE>
<TRANTIM>235000</TRANTIM>
<IFTYP>DRSTM</IFTYP>
<IFSEQNO>004937</IFSEQNO>
</Header>
<Detail>
<MVT_DATE>20090507</MVT_DATE>
<MVT_TYPE>223</MVT_TYPE>
<REF_NBR>0000014567</REF_NBR>
<MVT_REASON/>
<MATNR>108908</MATNR>
<PLANT>3025</PLANT>
<BATCH>NBM</BATCH>
<STG_LOC>PLCL</STG_LOC>
<STK_RC/>
<QTY>00000002.000</QTY>
<MATNR_TO>108908</MATNR_TO>
<PLANT_TO>3025</PLANT_TO>
<BATCH_TO>NBM</BATCH_TO>
<STG_LOC_TO>DAMA</STG_LOC_TO>
<STK_RC_TO/>
</Detail>
<Trailer>
<RECCOUNT>000001</RECCOUNT>
</Trailer>
</CEVAStockMovement>
from this an idoc will be created , so graphical mapping is used .
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.