Author |
Message
|
sleon807 |
Posted: Wed Apr 05, 2006 2:23 pm Post subject: ESQL doesn't work |
|
|
Novice
Joined: 17 Mar 2006 Posts: 11
|
Somebody can help me?
<?xml version="1.0" encoding="UTF-8"?>
<MSG>
<A>
<A1></A1>
.
<AN></AN>
</A>
<B>
<B1>
<B11>A</B11>
<B12>B</B12>
<B13>C</B13>
.
<B1N>X</B1N>
</B1>
<B2>
<B21>D</B21>
<B22>E</B22>
<B23>F</B23>
.
<B2N>X</B2N>
</B2>
.
.
<BN>...</BN>
</B>
</MSG>
Hi I hope that somebody can help me with this problem, I've been trying to get the number of structures below of <B> Tag e.g. <B1><B2>..<BN> but without sub-structures of these e.g. <B11><B12> .. <B21><B22>, etc. For doing this I'm using the function shown below but without success
DECLARE J INTEGER CARDINALITY(InputRoot.XML.MSG.B.*[]);
Once gotten this I'd like to get the name of structures that I got in the last step and assign them to a variable for compare them e.g. B1,B2...BN for this I've been using this functions but doesn't work.
SET NAME = FIELDNAME(InputRoot.XML.MSG.B.*[J]);
SET NAME = FIELDNAME(InputBody.XML.MSG.B.(XML.Element)[J]); |
|
Back to top |
|
 |
madi |
Posted: Wed Apr 05, 2006 3:41 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Quote: |
SET NAME = FIELDNAME(InputBody.XML.MSG.B.(XML.Element)[J]);
|
try SET NAME = FIELDNAME(InputBody.XML.MSG.B.(XML.tag)[J]);
Isnt NAME a reserved word, how are u using this?
I cannot think of a way to do your main part though, lets wait for some grand masters to respond.
--madi |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 05, 2006 6:06 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Read up on ESQL manual.
As an alternative and as I did not find it myself: have you tried passing the array and the locator/index in the array to java and having java return you the name ?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Apr 05, 2006 7:25 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi sleon807,
Declare a list e.g LocalEnvironment.Variables.BsList[]
Use the LIKE keyword e.g InputRoot.XML.MSG.B.*[] LIKE 'B%';
Store the list returned into the list that u created and use it.
I did not understand what u want to compare ? Please tell us what ur looking to do once you get this list.
Regards. |
|
Back to top |
|
 |
fschofer |
Posted: Thu Apr 06, 2006 12:23 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
put a trace node with ${Root} before your compute node and show us the output.
Also perform a trace with debug level of the compute node execution.
Greetings
Frank |
|
Back to top |
|
 |
dipankar |
Posted: Thu Apr 06, 2006 3:30 am Post subject: |
|
|
Disciple
Joined: 03 Feb 2005 Posts: 171
|
Hi Sleon807,
Try to use this
Code: |
FIELDNAME(InputBody.XML.MSG.B.(XML.Element)*[J]) |
I hope it works. _________________ Regards |
|
Back to top |
|
 |
sleon807 |
Posted: Mon Apr 10, 2006 9:18 am Post subject: |
|
|
Novice
Joined: 17 Mar 2006 Posts: 11
|
Ok, I tried to use what you told me but without success.
FIELDNAME(InputBody.XML.MSG.B.(XML.tag)[J]);
FIELDNAME(InputBody.XML.MSG.B.(XML.Element)*[J])
I realized that "InputBody" doesn't work and I changed it for "InputRoot", and all began to work perfectly
FIELDNAME(InputRoot.XML.MSG.B.(XML.tag)[J]);
FIELDNAME(InputRoot.XML.MSG.B.(XML.Element)*[J])
I used this code for the other topic and was useful.
Declare a list e.g LocalEnvironment.Variables.BsList[]
Use the LIKE keyword e.g InputRoot.XML.MSG.B.*[] LIKE 'B%';
THANKS FOR EVERYTHING |
|
Back to top |
|
 |
wschutz |
Posted: Mon Apr 10, 2006 9:34 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
If you are referring to the input message tree to interrogate its content in a Compute node, use correlation name InputBody followed by the path to the element to which you are referring. InputBody is equivalent to InputRoot followed by the parser name (for example, InputRoot.MRM), which you can use if you prefer.
|
just FYI _________________ -wayne |
|
Back to top |
|
 |
|