Author |
Message
|
CHERIANV |
Posted: Mon Jan 21, 2008 6:20 pm Post subject: ESQL assistance for the following XML scenario |
|
|
Apprentice
Joined: 15 Feb 2002 Posts: 43 Location: New York
|
Hi -
This looks simple but I'm having some issues. I need to extract the <TotalAmount> field where the attribute type='PurAmt' and assign it to an MRM field. I tried the different SELECT clauses and have no luck. Can someone suggest what is the best ESQL to extract this field ? Thanks !
<?xml version="1.0" encoding="UTF-8"?>
<Body>
<Line>
<TotalAmount currency="USD" type="PurAmt">10000.00</TotalAmount>
<TotalAmount currency="USD" type="NetAmt">20000.00</TotalAmount>
<TotalAmount currency="USD" type="ListAmt">30000.00</TotalAmount>
</Line>
</Body> |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Jan 21, 2008 7:48 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
What all select clauses you have already tried.? _________________ Cheers |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jan 22, 2008 1:52 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
Quote: |
Can someone suggest what is the best ESQL to extract this field ? |
Which domain are you using to parse the XML message? |
|
Back to top |
|
 |
CHERIANV |
Posted: Tue Jan 22, 2008 4:42 am Post subject: |
|
|
Apprentice
Joined: 15 Feb 2002 Posts: 43 Location: New York
|
Here are the SELECT clauses I tried that hasnt worked :
1.)
SET OutputRoot.MRM.CONTROL_RECORD..ZPURAMT = THE(SELECT ITEM TBL.TotalAmount FROM InputRoot.XML.Body.Line AS TBL
WHERE TBL.TotalAmount.(XML.attr)type = 'PurAmt');
2.)SET OutputRoot.MRM.CONTROL_RECORD..ZPURAMT = (SELECT TBL.TotalAmount FROM InputRoot.XML.Body.Line AS TBL
WHERE TBL.TotalAmount.(XML.attr)type = 'PurAmt');
3.)SET OutputRoot.MRM.CONTROL_RECORD..ZPURAMT = (SELECT ITEM TBL.TotalAmount FROM InputRoot.XML.Body.Line AS TBL
WHERE TBL.TotalAmount.(XML.attr)type = 'PurAmt');
Any clues on what would work in this scenario ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 22, 2008 4:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please don't use the XML domain.
I assume that the two dots between CONTROL_RECORD and ZPURAMT is a typo here, and not in your code.
What is populated in the output field from each of those selects? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
CHERIANV |
Posted: Tue Jan 22, 2008 10:24 am Post subject: |
|
|
Apprentice
Joined: 15 Feb 2002 Posts: 43 Location: New York
|
What does it mean to not use the XML domain ? Not to use it just in the SELECT clause or not to use the domain itself . What are the other options ?
You're right. The two dots are a typo and not in the code.
Nothing is populated from either of the SELECTs. I am tying to get the code to extract TotalAmount = 10000 for type = PurAmt.
Thanks for your assistance ! |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jan 23, 2008 3:06 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
|
Back to top |
|
 |
CHERIANV |
Posted: Wed Jan 23, 2008 7:02 pm Post subject: |
|
|
Apprentice
Joined: 15 Feb 2002 Posts: 43 Location: New York
|
Thanks ! I was able to resolve this. |
|
Back to top |
|
 |
|