on 02-20-2007 11:34 AM
Hi experts,
<Batch>
<BatchCode ID= AA>
<DeliveryNote>190098</DeliveryNote>
<LotQuantity>1560</LotQuantity>
</BatchCode>
<BatchCode ID= BB>
<DeliveryNote>190098</DeliveryNote>
<LotQuantity>1560</LotQuantity>
</BatchCode>
</Batch>
Target message:
<BatchDelivery>
<DeliveryNote>190098</DeliveryNote>
<DNQuantity>1560</LotQuantity>
</BatchDelivery>
From the source message I want to pull only those batch details where ID is BB.
How to handle thsi in mapping?
Thanks
Gopal
Hi,
Map the fields <DeliveryNote> and <LotQuantity> directly.
For the target node <BatchDelivery> use the condition ifWithOutElse. In the condition part use equlsS function. This function has 2 inputs. a)Constant "BB"" b)ID(attribute). Your mapping should look like this
Constant "BB"----
equalsS----if
ID----
BatchCode----
then
the output of this is mapped to the target node <BatchDelivery>.
I guess we discussed the same yesterday.
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
correction:
<xsl:copy-of select="//BatchCode/*[../@ID='BB']"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to copy, use <i>copy-of</i>
<xsl:copy-of select="//BatchCode/*[../@ID='BB']/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gopal,
if you wonder why nobody has a good and quick tip for you: the kind of mapping would be interesting to answer the question. You can solve that grafical, with Java, ABAP or XSL. But of coz it is easier to cry <b>PLEASE HELP!</b> than to think about required details.
grafical: just drag and drop
If you use XSL:
<xsl:value-of select="//BatchCode/@ID"/>
ABAP or Java is assumedly not used by you.
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabhu,
I ma sorry I have two levels of checks in my source XML.
<Batch>
<BatchCode ID= AA>
<BatchLabel>Primary</BatchLabel>
<DeliveryNote>190098</DeliveryNote>
<LotQuantity>1560</LotQuantity>
</BatchCode>
<BatchCode ID= BB>
<BatchLabel>Secondary</BatchLabel>
<DeliveryNote>190098</DeliveryNote>
<LotQuantity>1560</LotQuantity>
</BatchCode>
<BatchCode ID= BB>
<BatchLabel>Primary</BatchLabel>
<DeliveryNote>190098</DeliveryNote>
<LotQuantity>1560</LotQuantity>
</BatchCode>
</Batch>
So I need to pull batch details where first the BatchCode ID= AA and then where BatchLabel value is 'Primary'
Target message:
<BatchDelivery>
<DeliveryNote>190098</DeliveryNote>
<DNQuantity>1560</LotQuantity>
</BatchDelivery>
How to do the graphical mapping for this situation?
Thanks
Gopal
Hi Gopal,
see in your data type of your source message, you can add an attribute to your node......then in message mapping you can use this attribute to check with constant BB for equalS function - send its output to IF-THEN and then create your target node.
Thanks,
Rajeev Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gopal,
You need to parse this XML using XML parsers like DOM or SAX with Java Code. You can check the required node and its values in parsing..Then you can use your business logic...
You need to use Java Mapping to achieve the same..
I can send you a sample Java mapping code to you if you can give me your email id...
Hope this Helps..
Kiran..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.