Author |
Message
|
gaurav.udgir |
Posted: Tue Jun 09, 2009 8:42 pm Post subject: namespace and schema location in ESQL |
|
|
Apprentice
Joined: 18 May 2009 Posts: 32
|
Hi All,
I am having a XML in the following format:
<root xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:test test.xsd" xmlns="urn:iso:std:iso:20022:tech:xsd:test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" test="123"><test>
<order>
<MsgId>ABCDE</MsgId>
</order>
</test>
</root>
In the above message I need to get the value of the MsgId in a variable in ESQL. I am unable to handle the namespaces and schema location in the root element and getting the field as empty.
I tried using
SET value4 = FIELDVALUE(InputRoot.XMLNSC.root.test.order.(XMLNSC.Field)MsgId);
Please help.
Thank you.
Regards,
Gaurav |
|
Back to top |
|
 |
MQEnthu |
Posted: Tue Jun 09, 2009 9:23 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Your message has XML namespace... where as you are not accessing the fields with namespace in ESQL... try accessing the fields by specifying the namespace.. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
gaurav.udgir |
Posted: Tue Jun 09, 2009 9:58 pm Post subject: |
|
|
Apprentice
Joined: 18 May 2009 Posts: 32
|
Hi,
I tried to do that using the following code:
SET value1 = FIELDVALUE(InputRoot.XMLNSC.(XML.Element)*[1].*:schemaLocation);
SET value2 = FIELDVALUE(InputRoot.XMLNSC.root.(XMLNSC.DoubleNamespaceDecl)xmlns);
SET value3 = FIELDVALUE(InputRoot.XMLNSC.root.(XMLNSC.DoubleNamespaceDecl)"xmlns:xsi");
SET value4 = FIELDVALUE(InputRoot.XMLNSC.root.test.order.(XMLNSC.Field)MsgId);
But the result is still the same.
Please let em know if I am missing anything.
Regards,
Gaurav |
|
Back to top |
|
 |
MQEnthu |
Posted: Tue Jun 09, 2009 10:58 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Did you try something like this?
Code: |
InputRoot.XMLNSC.NS1:root.NS1:test.NS1:order.NS1:MsgId;
Where NS1= "urn:iso:std:iso:20022:tech:xsd:test" |
_________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 10, 2009 12:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gaurav.udgir wrote: |
Please let em know if I am missing anything.
|
What you're missing is a user trace; the single most useful way of determining what the broker's actually doing.
The problem would seem to be that this:
Code: |
SET value4 = FIELDVALUE(InputRoot.XMLNSC.root.test.order.(XMLNSC.Field)MsgId); |
does not allow for the XML document's default namespace. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|