Author |
Message
|
Lillian |
Posted: Tue Mar 14, 2006 2:04 am Post subject: xml- selecting tc attribute |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
WMQI 2.1
I am trying to select data from an xml based on the tc value ( attribute of the fields.
i am using an MRM imported from an xsd.
My problem is that i seem to "LOSE" the tc attribute as soon as I output to tree to the Environment variables and any subsequent select from the variables based on tc return NULL.
The id and other Relation attributes however come thru
I suspect the problem lies with MRM any ideas?
INCOMING XML:
<Relation id="CALREL1" OriginatingObjectID="CALHOLD1" RelatedObjectID="CALPARTY2">
<RelationKey>D012345</RelationKey>
<RelatedObjectType tc="6">PARTY</RelatedObjectType>
<RelationRoleCode tc="8">OWNER</RelationRoleCode>
<BenefRelationRoleCode tc="1" />
</Relation>
ESQL:
SET Environment.variables.RelatedObjectIDOwner[] = ( SELECT (RELATION) from "InputBody"."Reply"."OLifE"."Relation"[] as RELATION where RELATION."RelationRoleCode"."tc" ='8');
TRACE output:( note no tc attributes)
(0x1000000)RelatedObjectIDOwner = (
(0x1000000)RELATION = (
(0x3000000)id = 'CALREL1'
(0x3000000)OriginatingObjectID = 'CALHOLD1'
(0x3000000)RelatedObjectID = 'CALPARTY2'
(0x3000000)RelationKey = 'D012345'
(0x3000000)RelatedObjectType = 'PARTY'
(0x3000000)RelationRoleCode = 'OWNER'
(0x3000000)BenefRelationRoleCode = '' |
|
Back to top |
|
 |
dipankar |
Posted: Tue Mar 14, 2006 2:23 am Post subject: |
|
|
Disciple
Joined: 03 Feb 2005 Posts: 171
|
It may help you.
Code: |
Create FIRSTCHILD of Environment DOMAIN 'XML' Name 'Variables'; |
It is required to hold XML tree with attribute.
After that you populate environment variable by select clause. _________________ Regards |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Mar 14, 2006 3:08 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
|
Back to top |
|
 |
Lillian |
Posted: Tue Mar 14, 2006 3:31 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
Create FIRSTCHILD of Environment DOMAIN 'XML' Name 'Variables' ;
SET Environment.XML.Variables[] = ( SELECT (RELATION) from "InputBody"."Reply"."OLifE"."Relation"[] as RELATION where RELATION."RelationRoleCode"."tc" ='8');
still gives me :
(0x1000000)RELATION = (
(0x3000000)id = 'CALREL1'
(0x3000000)OriginatingObjectID = 'CALHOLD1'
(0x3000000)RelatedObjectID = 'CALPARTY2'
(0x3000000)RelationKey = 'D012345'
(0x3000000)RelatedObjectType = 'PARTY'
(0x3000000)RelationRoleCode = 'OWNER'
(0x3000000)BenefRelationRoleCode = ''
and SET Environment.Variables[] .... is empty |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Mar 14, 2006 3:49 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Lillian,
tc is an attribute not a field.
Add "....".(XML.Attr)"tc" =
Hope it works.
Regards. |
|
Back to top |
|
 |
Lillian |
Posted: Tue Mar 14, 2006 3:54 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
so is :
id="CALREL1"
OriginatingObjectID="CALHOLD1"
RelatedObjectID="CALPARTY2"
my confusion is why the above is in trace and not the tc |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Mar 14, 2006 4:03 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
|
Back to top |
|
 |
dipankar |
Posted: Wed Mar 15, 2006 7:16 pm Post subject: |
|
|
Disciple
Joined: 03 Feb 2005 Posts: 171
|
Code: |
SET Environment.XML.Variables[] = ( SELECT (RELATION) from "InputBody"."Reply"."OLifE"."Relation"[] as RELATION where RELATION."RelationRoleCode"."tc" ='8'); |
XML is domain, not a variable.
You should use
Code: |
SET Environment.Variables[] = ( SELECT (RELATION) from "InputBody"."Reply"."OLifE"."Relation"[] as RELATION where RELATION."RelationRoleCode"."tc" ='8'); |
Hope it works _________________ Regards |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Mar 15, 2006 8:15 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi dipankar,
So yes, XML is not a domain, it would get created as a variable in the tree...there is nothing stopping you to use it in the tree structure....
How could that be a reason for the problem ?
Regards. |
|
Back to top |
|
 |
dipankar |
Posted: Wed Mar 15, 2006 9:04 pm Post subject: |
|
|
Disciple
Joined: 03 Feb 2005 Posts: 171
|
Hi Elvis,
Code: |
Create FIRSTCHILD of Environment DOMAIN 'XML' Name 'Variables';
SET Environment.Variables[] = ( SELECT (RELATION) from "InputBody"."Reply"."OLifE"."Relation"[] as RELATION where RELATION."RelationRoleCode"."tc" ='8'); |
Here Environment.Variables only knows about the XML parser because we have created Variables as firstchild, not XML variable as firstchild.
Please correct me if I am wrong. _________________ Regards |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Mar 15, 2006 9:18 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
oo..oooo......oooooo
Ur previous post didn't have the
Quote: |
Create FIRSTCHILD of Environment DOMAIN 'XML' Name 'Variables'; |
and so i got mislead...
You are right....Good on you mate.
Regards. |
|
Back to top |
|
 |
dipankar |
Posted: Wed Mar 15, 2006 9:30 pm Post subject: |
|
|
Disciple
Joined: 03 Feb 2005 Posts: 171
|
Hi Elvis,
Thank you very much.
Hi Lillian,
I have tested with your xml message in my own system
Input:
Quote: |
<Reply>
<OLifE>
<Relation id="CALREL1" OriginatingObjectID="CALHOLD1" RelatedObjectID="CALPARTY2">
<RelationKey>D012345</RelationKey>
<RelatedObjectType tc="6">PARTY</RelatedObjectType>
<RelationRoleCode tc="8">OWNER</RelationRoleCode>
<BenefRelationRoleCode tc="1" />
</Relation>
</OLifE>
</Reply> |
Code:
Code: |
Create FIRSTCHILD of Environment DOMAIN 'XML' Name 'Variables';
SET Environment.Variables[] = ( SELECT (RELATION) from "InputBody"."Reply"."OLifE"."Relation"[] as RELATION where RELATION."RelationRoleCode"."tc" ='8');
SET Environment.XML.Variables[] = ( SELECT (RELATION) from "InputBody"."Reply"."OLifE"."Relation"[] as RELATION where RELATION."RelationRoleCode"."tc" ='8'); |
Trace:
(
Quote: |
0x1000010)Variables = (
(0x1000000)RELATION = (
(0x3000000)id = 'CALREL1'
(0x3000000)OriginatingObjectID = 'CALHOLD1'
(0x3000000)RelatedObjectID = 'CALPARTY2'
(0x2000000) = '
'
(0x1000000)RelationKey = (
(0x2000000) = 'D012345'
)
(0x2000000) = '
'
(0x1000000)RelatedObjectType = (
(0x3000000)tc = '6'
(0x2000000) = 'PARTY'
)
(0x2000000) = '
'
(0x1000000)RelationRoleCode = (
(0x3000000)tc = '8'
(0x2000000) = 'OWNER'
)
(0x2000000) = '
'
(0x1000000)BenefRelationRoleCode = (
(0x3000000)tc = '1'
)
(0x2000000) = '
'
)
)
(0x1000000)XML = (
(0x1000000)Variables = (
(0x1000000)RELATION = (
(0x3000000)id = 'CALREL1'
(0x3000000)OriginatingObjectID = 'CALHOLD1'
(0x3000000)RelatedObjectID = 'CALPARTY2'
(0x3000000)RelationKey = 'D012345'
(0x3000000)RelatedObjectType = 'PARTY'
(0x3000000)RelationRoleCode = 'OWNER'
(0x3000000)BenefRelationRoleCode = ''
)
)
)
) |
Hope it helps you. _________________ Regards |
|
Back to top |
|
 |
|