Author |
Message
|
j1 |
Posted: Thu Oct 28, 2004 1:36 pm Post subject: Referencing elements in RFH2 |
|
|
 Centurion
Joined: 23 Jun 2003 Posts: 139
|
Hi,
I have a requirement to reference an element within the RFH2 header but the tag coming before it may change. For example.
it may be
InputRoot.MQRFH2.<something>.C
what kind of wildcard char do i need to put in to reference C.
Thanks,
Sailesh |
|
Back to top |
|
 |
kirani |
Posted: Thu Oct 28, 2004 1:45 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
What is the position of this <something> element in your Tree? Is it the last element always? If so, you can use Anonymous field references like this,
Code: |
InputRoot.MQRFH2.*[LAST].C
|
_________________ 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 |
|
 |
j1 |
Posted: Thu Oct 28, 2004 1:48 pm Post subject: |
|
|
 Centurion
Joined: 23 Jun 2003 Posts: 139
|
it will be in the same position.
for eample, it may be :
InputRoot.MQRFH2.A.C
or
InputRoot.MQRFH2.B.C
would a
InputRoot.MQRFH2.[*].C
work?
thanks |
|
Back to top |
|
 |
kirani |
Posted: Thu Oct 28, 2004 1:55 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
What I ment was we need to know the position of this <something> element in MQRFH2 tree. For example, it could be the 3rd or last child of MQRFH2 tree? Can you print your ${Root} in a trace file and post the output here? _________________ 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 |
|
 |
j1 |
Posted: Thu Oct 28, 2004 2:05 pm Post subject: |
|
|
 Centurion
Joined: 23 Jun 2003 Posts: 139
|
i dont want to post the ${Root} but the <something> tag will always be at the same position, in this case the top level element after RFH2. basically we are putting an XML tree into the RFH2 and the elements after the top level tag will be the same and i can reference them explictly, but need a wildcard for the top level element. |
|
Back to top |
|
 |
siliconfish |
Posted: Thu Oct 28, 2004 2:14 pm Post subject: |
|
|
 Master
Joined: 12 Aug 2002 Posts: 203 Location: USA
|
Looks like u will have only one top level element after MQRFH2. Use InputRoot.MQRFH2.*[LAST].C as suggested by kiran. _________________ siliconfish |
|
Back to top |
|
 |
Nizam |
Posted: Thu Oct 28, 2004 2:25 pm Post subject: |
|
|
Disciple
Joined: 10 Feb 2004 Posts: 160
|
I guess
declare Ref REFERENCE TO InputRoot.MQRFH2.*[];
should work.
[2] refers to your 'c'. |
|
Back to top |
|
 |
j1 |
Posted: Thu Oct 28, 2004 2:30 pm Post subject: |
|
|
 Centurion
Joined: 23 Jun 2003 Posts: 139
|
it will always be the third child of the Tree. either way i guess an anonymous field reference to either
InputRoot.MQRFH2.[3]*.C
or
InputRoot.MQRFH2.[LAST]*.C
will be the answer..
Thanks for the help |
|
Back to top |
|
 |
EddieA |
Posted: Thu Oct 28, 2004 3:18 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
And if you are running v5:
Quote: |
For backward compatibility the LAST keyword is still supported, but its use is deprecated.
The LAST keyword has been replaced by the following arrow syntax, which allows both a direction of search and index to be specified:
Field [ > ] -- The first element, equivalent to [ 1 ]
Field [ > (a + b) * 2 ]
Field [ < ] -- The last element, equivalent to [ LAST ]
Field [ < 1 ] -- The last element, equivalent to [ LAST ]
Field [ < 2 ] -- The last but one element Field
[ < (a + b) / 3 ] |
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|