Author |
Message
|
dkeister |
Posted: Fri Aug 24, 2007 10:10 am Post subject: Question/Problem with XML.Attribute migrating from 5 to 6 |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
I have a working message flow that builds XML output messages using the following:
set OutputRoot.XML.RiskEventCollection.RiskEvent[] =
(Select
...
BT.AAMOUNT as ActualLosses.ActualLossCollection.ActualLoss.
LossAmount,
'USD' as ActualLosses.ActualLossCollection.ActualLoss.
LossAmount.(XML.Attribute)ccy,
...
BT.AAMOUNT as ActualLosses.ActualLossCollection.ActualLoss.
PostingInfo.GLPostingInfoCollection.GLPostingInfo.
Amount,
'USD' as ActualLosses.ActualLossCollection.ActualLoss.
PostingInfo.GLPostingInfoCollection.GLPostingInfo.
Amount.(XML.Attribute)ccy,
...
FROM Environment.Variables.BanTeller[] as BT
WHERE BT.SEQUENCE >= A AND
BT.SEQUENCE <= Z);
In 5 the output XML is as expected:
<LossAmount ccy="USD">6.03</LossAmount>
and
<Amount ccy="USD">6.03</Amount>
but in 6, LossAmount is missing the attribute ccy. The output XML looks like:
<LossAmount>6.03</LossAmount>
While Amount continues to work as expected and looks like
<Amount ccy="USD">6.03</Amount>
If I remove the BT.AMOUNT ... statement for Loss Amount I get:
<LossAmount ccy="USD"/>
I was able to fix this by changing:
BT.AAMOUNT as ActualLosses.ActualLossCollection.ActualLoss.
LossAmount,
to
BT.AAMOUNT as ActualLosses.ActualLossCollection.ActualLoss.
(XML.Element)LossAmount,
but have left the second (Creating Amount) as is and it now works.
Have I missed something??? _________________ Dean Keister |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 24, 2007 10:20 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please don't use XML domain...
What happens if you put in the XML.Attribute first, rather than second? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dkeister |
Posted: Fri Aug 24, 2007 10:28 am Post subject: |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
Tried that. (That was a problem with 2.1 if I recall) Same results.
I also tried:
- changing the label from LossAmount to BossAmount on both.
- adding My.LossAmount to both
Same results.
I also changed LossAmount to BossAmount for the attribute and I got
<LossAmount >6.03</LossAmount>
<BossAmount ccy="USD"/>
Confused in Connecticut. _________________ Dean Keister |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 24, 2007 10:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I guess it's not clear what's different between the two sets of data, the one that works and the one that doesn't...
You said you had something that worked, though?
You could look at a debug trace of the one that doesn't work, and see if you can see anything.
The only thing I can think of is that it's creating a Name element with a Value child in one case and a NameValue element in the other... and one of the two causes the problem. But I can't think why that would be happening - unless there was something different about the input field for 5 than for 6. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dkeister |
Posted: Fri Aug 24, 2007 10:40 am Post subject: |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
Both flows are going against the same data. The flows are both installed and going against the same Oracle database.
To make it work, I explicitly added (XML.Element) to the LossAmount entry and then it worked.
Still don't know why it works in one place and not the other. I'm not sure what a NameValue element is so I'll have some more weekend studying to do.
Thanks for the suggestions. _________________ Dean Keister |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 24, 2007 12:16 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
OH. *Version* 5 and *Version* 6.
I didn't understand that. I thought it was repeat #5 in the input message vs. repeat #6 in the input message...
I didn't read the subject line very well...
Name, Value, and NameValue are the three possibly types of MbElement... the building blocks of the logical message tree - where the type describes what the element holds : a name, a value, or both.
I would again suggest at least moving to XMLNS from XML. It's a minimal change in your code, but a big change in terms of maintainability/supportability/flexibility... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dkeister |
Posted: Fri Aug 24, 2007 12:20 pm Post subject: |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
Thanks.
You've mentioned the move to XMLNS on one of my prior posts...
The powers wanted as few changes as possible for regression/testing considerations.
Think I'll revisit this. _________________ Dean Keister |
|
Back to top |
|
 |
|