Author |
Message
|
sathish.mani |
Posted: Tue Mar 10, 2015 1:20 pm Post subject: Obtain a Specific namespace From Multiple Namespaces |
|
|
Newbie
Joined: 19 Nov 2014 Posts: 8
|
I am new to the message broker and ESQL and I am not sure how to obtain a specific namespace in a tag when there is more than one namespaces .
<return ns1='abc' ns2 = 'xyz' />
I need to obtain the value 'abc' which is namespace ns1. I beleive FIELDNAMESPACE(return) doesnt work when there is more than one.
Is there any way to specify the namespace name (ns1) to get that particular one..
Appreciate any help |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 10, 2015 2:03 pm Post subject: Re: Obtain a Specific namespace From Multiple Namespaces |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sathish.mani wrote: |
I am new to the message broker and ESQL and I am not sure how to obtain a specific namespace in a tag when there is more than one namespaces .
<return ns1='abc' ns2 = 'xyz' />
I need to obtain the value 'abc' which is namespace ns1. I beleive FIELDNAMESPACE(return) doesnt work when there is more than one.
Is there any way to specify the namespace name (ns1) to get that particular one..
Appreciate any help |
FIELDNAMESPACE does so work even if more than one namespaces are defined.
What you are missing here is that what you want is the namespace declaration type. So inspect the children and find the type with PARSER.XMLDecl or PARSER.XMLDeclaration ... Replace PARSER here with XMLNS or XMLNSC .... have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sathish.mani |
Posted: Tue Mar 10, 2015 4:25 pm Post subject: Re:Obtain a Specific namespace From Multiple Namespaces |
|
|
Newbie
Joined: 19 Nov 2014 Posts: 8
|
None of the children are of that type. Just to brief on my question, it is an incoming soap message where the <body> has a <return> tag with attributes and namespaces looking like this
<soap:Body>
<response>
<return xsi:type='dealer' xmlns:ns1:'http://abc.com'>
--
--
</return>
</response>
</soap:Body>
I am trying to obtain the attribute 'type' of value 'dealer' and assign it to a variable. Thanks for your help.  |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 11, 2015 4:29 am Post subject: Re:Obtain a Specific namespace From Multiple Namespaces |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sathish.mani wrote: |
None of the children are of that type. Just to brief on my question, it is an incoming soap message where the <body> has a <return> tag with attributes and namespaces looking like this
<soap:Body>
<response>
<return xsi:type='dealer' xmlns:ns1:'http://abc.com'>
--
--
</return>
</response>
</soap:Body>
I am trying to obtain the attribute 'type' of value 'dealer' and assign it to a variable. Thanks for your help.  |
Well return has a number of children in the tree. Among the children of return you have
- a child with FIELDNAME () = 'type' and namespace xsi, value 'dealer', type XMLNSC.Attribute
- a child with FIELDNAME() = 'ns1' namespace xmlns, value 'http://abc.com' type XMLNSC.NamespaceDecl
Hope this helps  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sathish.mani |
Posted: Wed Mar 11, 2015 6:19 am Post subject: Re:Obtain a Specific namespace From Multiple Namespaces |
|
|
Newbie
Joined: 19 Nov 2014 Posts: 8
|
fjb_saper wrote: |
sathish.mani wrote: |
None of the children are of that type. Just to brief on my question, it is an incoming soap message where the <body> has a <return> tag with attributes and namespaces looking like this
<soap:Body>
<response>
<return xsi:type='dealer' xmlns:ns1:'http://abc.com'>
--
--
</return>
</response>
</soap:Body>
I am trying to obtain the attribute 'type' of value 'dealer' and assign it to a variable. Thanks for your help.  |
Well return has a number of children in the tree. Among the children of return you have
- a child with FIELDNAME () = 'type' and namespace xsi, value 'dealer', type XMLNSC.Attribute
- a child with FIELDNAME() = 'ns1' namespace xmlns, value 'http://abc.com' type XMLNSC.NamespaceDecl
Hope this helps  |
I dont have any child of <return> of the field name 'type' with namespace xsi... It is available only as an attribute of the <return> tag. I need to make use of this value 'dealer', is there any command to make use of it?? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 11, 2015 7:37 am Post subject: Re:Obtain a Specific namespace From Multiple Namespaces |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sathish.mani wrote: |
I dont have any child of <return> of the field name 'type' with namespace xsi... It is available only as an attribute of the <return> tag. I need to make use of this value 'dealer', is there any command to make use of it?? |
It shows that you are not listening and know little about the way the product uses and manipulates XML.
Any attribute of the return tag is portrayed as a child of the return element in the XMLNSC tree with type XMLNSC.Attribute...
Put a trace node into the flow with ${Root} and look at how the message tree unfolds...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sathish.mani |
Posted: Wed Mar 11, 2015 7:52 am Post subject: Re:Obtain a Specific namespace From Multiple Namespaces |
|
|
Newbie
Joined: 19 Nov 2014 Posts: 8
|
fjb_saper wrote: |
sathish.mani wrote: |
I dont have any child of <return> of the field name 'type' with namespace xsi... It is available only as an attribute of the <return> tag. I need to make use of this value 'dealer', is there any command to make use of it?? |
It shows that you are not listening and know little about the way the product uses and manipulates XML.
Any attribute of the return tag is portrayed as a child of the return element in the XMLNSC tree with type XMLNSC.Attribute...
Put a trace node into the flow with ${Root} and look at how the message tree unfolds...  |
It works now. I understood what you were saying but there was an error in code and that's why it is not working for me. But yeah I am new to message broker and hoping to learn a lot. Thanks for your help. |
|
Back to top |
|
 |
|