Author |
Message
|
Lillian |
Posted: Mon Feb 06, 2006 2:16 am Post subject: XML field REFERENCING |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
I am not very familiar with xml datatypes,
How does one reference "Value" in the following trace.
(0x1000015)Field = (
(0x300000B)Name = 'TAXYEAR'
(0x1000013)Value = (
(0x200000B) = '28022003'
)
(0x3000015)Other = 'None'
InputBody.Field.Value returns NULL
Where as from
(0x1000015)Field = (
(0x300000B)Name = 'TAXYEAR'
(0x3000015)Test = '28022003'
(0x3000015)Other = 'None'
InputBody.Field.Test returns '28022003'
I think it has something to do with the (0x200000B) level name.
Please help. |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Feb 06, 2006 2:29 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Lillian,
It would be simpler for us to help you if u just show us the input XML and then the code.
Regards. |
|
Back to top |
|
 |
Lillian |
Posted: Mon Feb 06, 2006 2:54 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
The actual xml is huge , but a snippet is as below:I am looking to map the value of TAXYEAR ie "28022003" but my selects are returning NULL.
XXXXXXXXXXXx
SET Environment.variables.NonSTDInfo[] = ( SELECT (NSTDI) from "InputBody"."Reply"."OLifE"."OLifEExtension"."NonStandardInfo"[] as NSTDI ) where NSTDI."Field"."Name" ='TAXYEAR');
XXXXXX
<OLifEExtension> <DocumentName>LACO-Tax Certificate</DocumentName>
<NonStandardInfo>
<Field> <Name>PARTY.TYPE</Name> <Value>300</Value> <Other>None</Other>
</Field>
<Field> <Name>EMAIL</Name> <Test>sastri@sastri.co.za</Test> <Other>None</Other></Field>
<Field> <Name>TAXYEAR</Name> <Value>28022003</Value> <Other>None</Other> </Field>
<Field> <Name>TAXAMOUNT</Name> <Value>6411.23</Value> <Other>None</Other> </Field>
<Field> <Name>TYPE</Name> <Value>RA</Value> <Other>None</Other> </Field>
</NonStandardInfo>
</OLifEExtension> |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Feb 06, 2006 3:05 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Lillian,
Ur select statement seems to have an extra ")"...you should be getting an error due to that....
I hope you are tracing down the hierarchy("InputBody"."Reply"."OLifE"."OLifEExtension"."NonStandardInfo") correctly ...what is the name of the input message,,....i mean the First XML tag.
Also it should be SELECT NSTDI.* from.....
Regards. |
|
Back to top |
|
 |
Lillian |
Posted: Mon Feb 06, 2006 3:47 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
I am dragging the elements from the MRM definition... so I think the tree is OK.
Still having issues as soon as I reference the Name or Value ie
SET Environment.variables.NonSTDInfo[] = ( SELECT (NSTDI.*) from "InputBody".TXLife."Reply"."OLifE"."OLifEExtension"."NonStandardInfo"[] as NSTDI where NSTDI."Field".(XML.Element)Name.(XML.Content)='TAXYEAR');
returns NULL
BUT
SET Environment.variables.NonSTDInfo[] = ( SELECT (NSTDI.*) from "InputBody".TXLife."Reply"."OLifE"."OLifEExtension"."NonStandardInfo"[] as NSTDI );
Returns data in the tree.(trace)
Light on the "any" datatypes would be appreciated. OLifEExtension is defined as "any". |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Feb 06, 2006 4:12 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Lillian,
Lillian wrote: |
so I think the tree is OK |
Then why did you have to change
Code: |
"InputBody"."Reply"."OLifE" |
to
Code: |
"InputBody".TXLife."Reply"."OLifE" |
Anyway, since ur second snippet is working that means that the reference is ok now. The reason for not getting the tree in the first case is not the datatypes...atleast not in your case.
You should try
Code: |
where NSTDI."Field"."Name"='TAXYEAR'; |
It should work, run it through the debugger and go step by step.
Regards. |
|
Back to top |
|
 |
Lillian |
Posted: Mon Feb 06, 2006 4:21 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
I have already tried without the xml definition as suggested.... still not working.
Can someone please explain the difference in the trace display specifically what the B in the tagline means.
I am able to reference Test and not Name.
(0x300000B)Name = 'TAXYEAR'
(0x3000015)Test = '28022003' |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Feb 06, 2006 4:32 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
0x300000B is simply a Hex/Binary representation.....it is not of significance.
I dont understand....you sometimes tell me that '28022003' is contained in the field "Value"...In your last post it is in "Test"...
I think you need to use one sample for testing your code...and make sure the occurance of Field where Name=TAXYEAR exists...
Regards. |
|
Back to top |
|
 |
Lillian |
Posted: Mon Feb 06, 2006 4:37 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
This is what I am confused about.
If I change the tag name to "Test", the selects works but not if the tag name is "Value" |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Feb 06, 2006 5:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Value is a reserved word.
If you want to use it as an identifier in your message tree, you need to put it in double-quotes.
Try InputBody.Field."Value", rather than InputBody.Field.Value. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|