|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XML attributes lost |
« View previous topic :: View next topic » |
Author |
Message
|
shalabh1976 |
Posted: Tue Dec 20, 2005 2:00 am Post subject: XML attributes lost |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Hi,
This is in reference to my earlier post: http://www.mqseries.net/phpBB2/viewtopic.php?t=26054
Consider the following XML:
<root>
<Child Name = "1" Type = "Male">
<Grandchild Name = "2" Type "Male">
<Grandgrandchild Name = "3" Type = "Male">x</Grandgrandchild>
<Grandgrandchild Name = "3" Type = "Female">y</Grandgrandchild>
</Grandchild>
<Grandchild Name = "2" Type "Female">
<Grandgrandchild Name = "3" Type = "Male">x</Grandgrandchild>
<Grandgrandchild Name = "3" Type = "Female">y</Grandgrandchild>
</Grandchild>
</Child>
<Child Name = "1" Type = "Female">
<Grandchild Name = "2" Type "Male">
<Grandgrandchild Name = "3" Type = "Male">x</Grandgrandchild>
<Grandgrandchild Name = "3" Type = "Female">y</Grandgrandchild>
</Grandchild>
<Grandchild Name = "2" Type "Female">
<Grandgrandchild Name = "3" Type = "Male">x</Grandgrandchild>
<Grandgrandchild Name = "3" Type = "Female">y</Grandgrandchild>
</Grandchild>
</Child>
</root>
I was completely unable to refer to any grandgrandchild from the root using a single XML statement.
So as suggested by elvis_gn, I used Select.
My select was of the form:
Code: |
SET Environment.Variables[Counter].Var = (SELECT A.Child FROM InputRoot.XML.root AS A where A.Child.(XML.Attribute)Type = 'Male'); |
This resulted in the correct Child being selected as I saw from the filetrace.
However the values of the Grandgrandchild appeared as x & y but the attribute values of Name and Type were not displayed.
Further selects on Grandchild using thgeir XML attributes showed that the parser was unable to Navigate path because they did not exist( from mqsichangetrace).
I need these attribute values to select the correct grandgrandchild.
How do I do this ? _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Dec 20, 2005 2:30 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
|
Back to top |
|
 |
shalabh1976 |
Posted: Tue Dec 20, 2005 2:48 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Elvis:
Results look promising:
The key was :
Code: |
Create FIRSTCHILD of Environment DOMAIN 'XML' Name 'Variables'; |
I come back if I get stuck.
The reason for using a new post was that the old post dealt with a different issue. Anyway my new post does refer to the old one and I did give credit to your solution.
I'll get back to my code now. _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Dec 20, 2005 2:53 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi shalabh1976,
since you gave me credit, I am taking special interest in your posts
kidding, i see that u moved on from the last problem.
Hope you get this one too.
Regards. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|