ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Namespace declaration in XMLNSC

Post new topic  Reply to topic
 Namespace declaration in XMLNSC « View previous topic :: View next topic » 
Author Message
KoGor
PostPosted: Mon Feb 24, 2014 1:31 am    Post subject: Namespace declaration in XMLNSC Reply with quote

Voyager

Joined: 09 Nov 2005
Posts: 81
Location: Moscow,Russia.

Is it possible in XMLNSC output message to set custom namespace different from default NS1 and etc?

There is no problem with domain XMLNS. As information center says the code is working well:

Code:
   SET OutputRoot.XMLNS.message.(XML.NamespaceDecl)xmlns:space1 = 'http://www.ibm.com/space1';   
   SET OutputRoot.XMLNS.message.sp1:data1 = 'Hello!';         


But I still could not figure out how to set it with XMLNSC domain. Is it possible at all?

Thank you in advance!
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Mon Feb 24, 2014 1:41 am    Post subject: Re: Namespace declaration in XMLNSC Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

You have to do some work for your namespaces to work properly.

Define them at the beginning of your code (or in a separate esql (that you probably "include")).

DECLARE sp1 NAMESPACE 'http://www....';

Then use it, and yes it is also possible to get you own names into it (not just NS1, NS2, ... Broker just uses that if it doesn't know better, because you missed to tell him).
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
KoGor
PostPosted: Mon Feb 24, 2014 1:53 am    Post subject: Reply with quote

Voyager

Joined: 09 Nov 2005
Posts: 81
Location: Moscow,Russia.

Here is the sample that I tried. I have manage to set my own namespace (space1) only with XMLNS parser. When I just replace XMLNS with XMLNSC domain WMB (v7006) is changing my namespace to its own default NS1 value.

Code:
CREATE COMPUTE MODULE TestFlow_Compute1
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      DECLARE sp1 NAMESPACE 'http://www.ibm.com/space1';
      
      -- Namespace declaration for prefix 'space1' 
      CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNS' ;
      SET OutputRoot.XMLNS.message.(XML.NamespaceDecl)xmlns:space1 = 'http://www.ibm.com/space1';   
      SET OutputRoot.XMLNS.message.sp1:data1 = 'Hello!';         
      RETURN TRUE;
   END;

The output for XMLNS domain:

Code:
<message xmlns:space1="http://www.ibm.com/space1">
 <space1:data1>Hello!</space1:data1>
</message>


The output for XMLNSC domain:

Code:
<message xmlns:NS1="http://www.ibm.com/space1">
 <NS1:data1>Hello!</NS1:data1>
</message>
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Mon Feb 24, 2014 2:16 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

This has been discussed before (2009).
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
KoGor
PostPosted: Mon Feb 24, 2014 3:43 am    Post subject: Reply with quote

Voyager

Joined: 09 Nov 2005
Posts: 81
Location: Moscow,Russia.

Thank you mqsiuser!
I have added double quotation marks to namespace and it worked!

SET OutputRoot.XMLNSC.message.(XMLNSC.NamespaceDecl)xmlns:"space1" = 'http://www.ibm.com/space1';
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Mon Feb 24, 2014 3:50 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Thank you too

I like you too

Credits actually belong to Kimbert

And you could try harder on googling the forum/internet, before opening a new thread.
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Feb 24, 2014 5:38 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I have added double quotation marks to namespace and it worked!
I refuse to take the credit for making it work, if you are claiming that changing the quotes was the answer!
A string constant in ESQL is usually single-quoted. Your new code works because you are using XMLNSC.NamespaceDecl instead of XML.NamespaceDecl.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
KoGor
PostPosted: Tue Feb 25, 2014 1:06 am    Post subject: Reply with quote

Voyager

Joined: 09 Nov 2005
Posts: 81
Location: Moscow,Russia.

Take my words back it is not double quotation marks solved the problem. It really was my mistake. I have not replaced XML.NamespaceDecl by XMLNSC.NamespaceDecl while running the sample . Now I removed double quotation marks and it's working still. Thank you for pointing that out!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Namespace declaration in XMLNSC
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.