Author |
Message
|
dyson |
Posted: Tue Jun 05, 2012 10:57 am Post subject: accessing default namespace within ESQL |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
My messages flow needs to consume and tweek an xml with a default namespace but I can't access the message tree via ESQL, I'm using WMB 6.1. What am missing here are there issues with ESQL and accessing default namespaces? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Jun 05, 2012 11:01 am Post subject: Re: accessing default namespace within ESQL |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
dyson wrote: |
but I can't access the message tree via ESQL, I'm using WMB 6.1. |
Would you care to explain why you can't access the message tree using ESQL? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
dyson |
Posted: Tue Jun 05, 2012 11:10 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
maybe I'm just missing something obvious but when I try set a variable I get nothing. I've tried a couple of diff versions:
set test = InputBody.POSLog.Transaction.RetailStoreID;
set tester = InputRoot.XMLNSC.POSLog.Transaction.RetailStoreID; |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Jun 05, 2012 11:12 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
dyson |
Posted: Tue Jun 05, 2012 11:15 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
It works if modify the incoming xml so that the namespace has a specific prefix and then declare that namespace in the ESQL, but I don't think that's good solution. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 05, 2012 11:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dyson wrote: |
It works if modify the incoming xml so that the namespace has a specific prefix and then declare that namespace in the ESQL, but I don't think that's good solution. |
No it isn't.
If you know the element is in a namespace but don't know what namespace and don't care what namespace why not access the element in any namespace? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dyson |
Posted: Tue Jun 05, 2012 11:34 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
it's in there:
[(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x7e13cb0]
(0x01000400:NamespaceDecl):XmlDeclaration = (
(0x03000100:Attribute):Version = '1.0' (CHARACTER)
(0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
)
(0x01000000:Folder )http://www.nrf-arts.org/IXRetail/namespace/:POSLog = (
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:sa = 'Lookup table for SA extensions' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:xsi = 'http://www.w3.org/2001/XMLSchema-instance' (CHARACTER)
(0x03000102:NamespaceDecl):xmlns = 'http://www.nrf-arts.org/IXRetail/namespace/' (CHARACTER)
(0x03000100:Attribute )http://www.w3.org/2001/XMLSchema-instance:schemaLocation = 'http://www.nrf-arts.org/IXRetail/namespace/IBMPOSLog.xsd' (CHARACTER)
(0x01000000:Folder )http://www.nrf-arts.org/IXRetail/namespace/:Transaction = (
(0x03000000:PCDataField)http://www.nrf-arts.org/IXRetail/namespace/:RetailStoreID = ' 123' (CHARACTER) ...] |
|
Back to top |
|
 |
dyson |
Posted: Tue Jun 05, 2012 11:36 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
by any namespace you mean:
set tester = InputRoot.XMLNSC.*:POSLog.Transaction.RetailStoreID;
? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 05, 2012 11:40 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
dyson wrote: |
by any namespace you mean:
set tester = InputRoot.XMLNSC.*:POSLog.Transaction.RetailStoreID;
? |
Except that you have to specify the namespace on EVERY element. |
|
Back to top |
|
 |
dyson |
Posted: Tue Jun 05, 2012 11:45 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
That didn't work I guess I missunderstood ... I've also tried declaring the namespace and refrencing:
[
DECLARE arts NAMESPACE 'http://www.nrf-arts.org/IXRetail/namespace/';
set test = InputRoot.XMLNSC.arts:POSLog.Transaction.RetailStoreID;
] |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Jun 05, 2012 11:45 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 05, 2012 11:48 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
POSLog needs a namespace qualifier.
Transaction needs a namespace qualifier.
RetailStoreID needs a namespace qualifier.
EVERY element that has a namespace needs a namespace qualifier. |
|
Back to top |
|
 |
dyson |
Posted: Tue Jun 05, 2012 11:51 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
Just tried
[
set tester = InputRoot.XMLNSC.*:POSLog.*:Transaction.*:RetailStoreID;
]
still no luck hows my syntax? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 05, 2012 11:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
lancelotlinc wrote: |
Please use [c od e ] tags. |
"[" and "]" are not [c o d e] tags.
dyson wrote: |
still no luck |
Take a user trace. |
|
Back to top |
|
 |
dyson |
Posted: Tue Jun 05, 2012 11:56 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2011 Posts: 45
|
got it ... sorry I'm being a little slow. I'll do the trace, thx. |
|
Back to top |
|
 |
|