|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
pass namespace qualified variables to a SELECT function? |
« View previous topic :: View next topic » |
Author |
Message
|
gechu |
Posted: Wed Jun 22, 2011 7:25 am Post subject: pass namespace qualified variables to a SELECT function? |
|
|
Apprentice
Joined: 27 Feb 2008 Posts: 48
|
I´m using the Mapping Node, which (I think) uses the MRM domain. The code I write is pseudocode, let me know if´s too ambigious. And this is what my source logical tree, variable declarations and SELECT function looks like:
Code: |
$source/ns1:myRootElement/ns1:header/ns1:data/ns1:repeatingElement
ns1:repeatingElement
ns1:qualifier = XYZ
ns1:valueToBeReturned = '123'
DECLARE sourceRef REFERENCE '$source/ns1:myRootElement/ns1:header/ns1:data'
DECLARE myChar CHARACTER;
DECLARE ns1 NAMESPACE 'http://www.ford.com/oagis';
SET myChar = THE(SELECT ITEM I.{'ns1:valueToBeReturned'} FROM $sourcePath.{'ns1:repeatingElement'}[] AS I WHERE I.{'ns1:qualifier'} = 'XYZ');
|
All values in the curly brackets are character variables but for clarity I´ve replaced them with their actual values. The passing of "sourceRef" works. I think I have problems passing other values (the ones inside curly brackets) which I use in a SELECT function.
I´m not sure, but I think the SELECT fails because the way I access elements using namespaces. But I am not sure. Any clues why it doesn´t work?
UPDATE: this is related to the way I access elements.
This is what I tried and it worked!
Code: |
DECLARE testingRef REFERENCE TO sourceRef;
MOVE testingRef FIRSTCHILD NAMESPACE 'http://www.theNamepace/used' NAME 'repeatingElement'; |
In my SELECT function, in the FROM section and other section too, I want to achieve the same thing, but I guess the syntax i wrong. Here is the code extracted from the SELECT funtion:
Code: |
FROM $sourcePath.{'ns1:repeatingElement'}[] |
How can I write that line with namespace support?
Just a note, this kind of function have proven useful when dealing with SAP and OAGIS XML structures. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 22, 2011 9:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried:
Code: |
from $sourcePath.ns1:{'repeatingElement'} |
or even
Code: |
from $sourcePath.{myns}:{myelt} |
And there is always the EVAL statement .... including the caveat for performance...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gechu |
Posted: Wed Jun 22, 2011 11:40 pm Post subject: |
|
|
Apprentice
Joined: 27 Feb 2008 Posts: 48
|
Both worked! Thanks a lot man!  |
|
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
|
|
|
|