Author |
Message
|
neo_revolution |
Posted: Thu Mar 11, 2004 6:48 am Post subject: Accessing OutPutTree dynamically |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
Hello,
I am trying to do something like this,
-------
CREATE FIELD OutputRoot.XML.Message.Temp;
CREATE FIELD OutputRoot.XML.Message.Body;
SET OutputRoot.XML.Message.Temp.(XML.AsisElementContent) = InputRoot.XML.Field1;
SET OutputRoot.XML.Message.Body = OutputRoot.XML.Message.Temp.TempField1;
------------------
Its returning me a null. It seems I can't access subtree of the OutputRoot's Temp tree.
Is there a way to access subtree's of the OutputRoots dynamically created subtrees.
Thanks in advance. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 11, 2004 7:26 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
From the coding you've provided, you haven't built OutputRoot.XML.Message.Temp.TempField1, so trying to read it will give you null,
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
neo_revolution |
Posted: Thu Mar 11, 2004 7:31 am Post subject: |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
I am assigning a XML tree for the Temp variable and I am trying to access an element from that subtree. Can I do that? |
|
Back to top |
|
 |
Missam |
Posted: Thu Mar 11, 2004 7:56 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
yes you can access the fields in the output tree structure(if they exists). |
|
Back to top |
|
 |
kirani |
Posted: Thu Mar 11, 2004 11:38 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Can you post a sample input message? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
neo_revolution |
Posted: Fri Mar 12, 2004 6:47 am Post subject: |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
Here is whats actually happening ........
I am converting a sub-xml tree into bitstream using ASBITSTREAM.
<Messsage>
<Header>
..........
</Header>
<Body>
<Field1>428905787583904788465784365478956</Field1>
</Body>
</Message>
This is my input message....
The bitstream is a sub-xml tree say this structure...
<Field1>
<element1>a</element1>
<element2>b</element2>
<element3>c</element3>
<element4>d</element4>
</Field1>
In the compute node I am casting bitstream to CHAR and getting the XML structure....
DECLARE msgBlob BLOB;
DECLARE charString CHAR;
SET msgBLOB = InputRoot.XML.Message.Body.Field1;
SET OutputRoot.XML.Message.Temp.(XML.AsisElementContent) = CAST
(msgBLOB as CHAR);
SET OutputRoot.XML.Message.ActualField = OutputRoot.XML.Message.Temp.Field1;
The last statement is not working its setting to null....
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 12, 2004 7:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Quote: |
The bitstream is a sub-xml tree say this structure... |
No. It's a bitstream.
If you want a tree from a bitstream, you have to PARSE it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
neo_revolution |
Posted: Fri Mar 12, 2004 7:55 am Post subject: |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
I parsed it using CREATE FIELD options and I was able to access the bitstream xml tree. Thanks for the help. |
|
Back to top |
|
 |
Missam |
Posted: Fri Mar 12, 2004 8:33 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Use a trace node after the compute node and print the structure of OutputRoot.XML.Message and see whether the structure represent the structure you are looking for.and can you print the trace here |
|
Back to top |
|
 |
|