|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
REFERENCE TO problem |
« View previous topic :: View next topic » |
Author |
Message
|
smeunier |
Posted: Thu Dec 11, 2003 7:07 am Post subject: REFERENCE TO problem |
|
|
 Partisan
Joined: 19 Aug 2002 Posts: 305 Location: Green Mountains of Vermont
|
I'm trying to declare a REFERENCE TO a value for a rather long node traversal path(te example below is a simulation). When I do, the trace shows that the REFERENCE TO value is not expanded and errors in a "Failed to navigate to path element because it does not exist.
"
Below is my REFERENCE TO:
DECLARE RefToBO REFERENCE TO OutputRoot.XML.(XML.Element)"BO_SAP_z_disburse_trg:BO_SAP_z_disburse_trg";
My Usage:
SET RefToBO.(XML.Attribute)locale='en_US';
Trace Output:
2003-12-11 09:00:33.325000 2908 UserTrace BIP2537I: Node 'SAP.MSGFLOW.Z_DISBURSE_TRG.XML2WBIA.XML TO BO': Executing statement 'DECLARE RefToBO REFERENCE TO OutputRoot.XML.(XML.Element)BO_SAP_z_disburse_trg:BO_SAP_z_disburse_trg;' at (13, 1).
2003-12-11 09:00:33.325000 2908 UserTrace BIP2543E: Node 'SAP.MSGFLOW.Z_DISBURSE_TRG.XML2WBIA.XML TO BO': (13, 41) : Failed to navigate to path element because it does not exist.
I'm not sure why I would get this, it appears the perhaps the XML hierarchy is not known. I have SET OutputRoot.Properties.MessageFormat = 'XML'; prior to this statement. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 11, 2003 7:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Have you created OutputRoot.XML.(XML.Element)"BO_SAP_z_disburse_trg:BO_SAP_z_disburse_trg" before you try and point the reference to it? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
smeunier |
Posted: Thu Dec 11, 2003 10:51 am Post subject: |
|
|
 Partisan
Joined: 19 Aug 2002 Posts: 305 Location: Green Mountains of Vermont
|
N, I did not create the node prior to the declaration. This would seem to defeat the purpose, as I would like to use it to create the node to begine with. With taht train of thought, I would need to predefine all XML node prior to being able to use a REFERENCE statement. Seems a little counter intuitive. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 11, 2003 11:55 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
smeunier wrote: |
N, I did not create the node prior to the declaration. This would seem to defeat the purpose, as I would like to use it to create the node to begine with. With taht train of thought, I would need to predefine all XML node prior to being able to use a REFERENCE statement. Seems a little counter intuitive. |
I don't know about counter intuitive or not. If you're trying to use a reference in order to shorten most of your code, then you can use the Create Field statement to create the field first, then declare your reference, and then use the reference.
You can assign values to fields that don't exist - this will cause the system to create the fields. You can't create references to fields that don't exist, however. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
smeunier |
Posted: Thu Dec 11, 2003 5:18 pm Post subject: |
|
|
 Partisan
Joined: 19 Aug 2002 Posts: 305 Location: Green Mountains of Vermont
|
Is it possible to nest the two functions (CREATE, REFERENCE ) satements, so that only one reference to the XML path needs to be specified? I have tried the following, but cannot get past the syntax checker.
DECLARE RefToBO REFERENCE TO (CREATE FIELD OutputRoot.XML.(XML.Element)"BO_SAP_z_disburse_trg:BO_SAP_z_disburse_trg"); |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 12, 2003 7:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
smeunier wrote: |
Is it possible to nest the two functions (CREATE, REFERENCE ) satements, so that only one reference to the XML path needs to be specified? I have tried the following, but cannot get past the syntax checker.
DECLARE RefToBO REFERENCE TO (CREATE FIELD OutputRoot.XML.(XML.Element)"BO_SAP_z_disburse_trg:BO_SAP_z_disburse_trg"); |
If you can't get past the syntax checker, then I would say that it is not possible.
Plus, I do not believe that CREATE FIELD "returns" anything.
There is always the other, somewhat slower route, using {}.
Code: |
declare myFieldName character "BO_SAP_z_disburse_trg:BO_SAP_z_disburse_trg";
create field OutputRoot.XML.(XML.Element){myFieldName};
declare RefToBo reference to OutputRoot.XML.(XML.Element){myFieldName}; |
_________________ I am *not* the model of the modern major general. |
|
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
|
|
|
|