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 » problems with namespace

Post new topic  Reply to topic
 problems with namespace « View previous topic :: View next topic » 
Author Message
dweller
PostPosted: Wed Nov 08, 2006 6:08 am    Post subject: problems with namespace Reply with quote

Apprentice

Joined: 31 Oct 2006
Posts: 28

in compute node i have this line:

SET OutputRoot.XMLNSC.Envelope.(XMLNSC.NamespaceDecl)xmlns = 'http://www.envelope.com/MBM';

in output xml i get this:

<Envelope xmlns="" xmlns="http://www.intentia.com/MBM"/>

where did that first xmlns come from?
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Nov 08, 2006 6:39 am    Post subject: Re: problems with namespace Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi dweller,
dweller wrote:
SET OutputRoot.XMLNSC.Envelope.(XMLNSC.NamespaceDecl)xmlns = 'http://www.envelope.com/MBM';
Is this the only line of code...plz paste the rest.

Regards.
Back to top
View user's profile Send private message Send e-mail
dweller
PostPosted: Wed Nov 08, 2006 6:45 am    Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2006
Posts: 28

BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
SET OutputRoot.XMLNSC.Envelope.(XMLNSC.NamespaceDecl)xmlns = 'http://www.envelope.com/MBM';
RETURN TRUE;
END;


and btw in Debug mode, Variables view there is only one xmlns variable(not the empty one). But rfhutil still shows that second empty xmlns declaration.

wmb 6.0, rfhutil 3.1
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Nov 08, 2006 7:48 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi dweller,
dweller wrote:
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();

DECLARE xmlns NAMESPACE 'http://www.envelope.com/MBM';
SET OutputRoot.XMLNSC.xmlns:Envelope.(XMLNSC.NamespaceDecl)xmlns = 'http://www.envelope.com/MBM';
RETURN TRUE;
END;
Just try this and tell me if the extra xmlns disappears...

Regards.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Wed Nov 08, 2006 8:37 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Elvis: Watch out! The XML specification clearly says
Quote:
The prefix xmlns is used only to declare namespace bindings and is by definition bound to the namespace name http://www.w3.org/2000/xmlns/. It MUST NOT be declared . Other prefixes MUST NOT be bound to this namespace name, and it MUST NOT be declared as the default namespace. Element names MUST NOT have the prefix xmlns.
I realise that this is ESQL, not an XML document. But it is very bad practice to use the prefix 'xmlns' for anything other than its intended purpose. In this case, 'mbm' might be a good alternative.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Nov 08, 2006 9:04 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi kimbert,

Are u referring to my using xmlns in the declare statement ? Yes I could have used anything there...used it only to help dweller relate that the default namespace(appearing as only "xmlns" and no prefixes in the output) is the one used on the field "Envelope" too...if there was a prefix used, I would have definitely used that...

I don't think I violated any of the other rules you mentioned above...did I ?

Regards.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Nov 09, 2006 2:10 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

elvis,

I can see why you did it. But I would advise against using xmlns as a namespace constant. When somebody writes ESQL like this
Code:
DECLARE myNS NAMESPACE http://myNamespace.com
they are usually declaring 'myNS' as a 'namespace prefix' for use in ESQL. So an ESQL NAMESPACE constant is very similar to an XML Namespace declaration. They both allow a long namespace to be abbreviated. It is bad practice to use ESQL namespace constants in a way which would be illegal in an XML document.
Back to top
View user's profile Send private message
dweller
PostPosted: Thu Nov 09, 2006 2:25 am    Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2006
Posts: 28

thanx for replies.

i need to generate root element with namespaces like this:
<Envelope xmlns="http://www.envelope.com/MBM" xmlns:env="http://www.envelope.com/MBM_Envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

this code does it, but it adds that extra empty xmlns namespace declaration:

SET OutputRoot.XMLNSC.Envelope.(XMLNSC.NamespaceDecl)xmlns = 'http://www.intentia.com/MBM';
SET OutputRoot.XMLNSC.Envelope.(XMLNSC.NamespaceDecl)xmlns:env = 'http://www.envelope.com/MBM_Envelope';
SET OutputRoot.XMLNSC.Envelope.(XMLNSC.NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.XMLNSC.Envelope.(XMLNSC.NamespaceDecl)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema';

then i declare namespaces and write xml.

declaring xmlns before adding to envelope like you wrote did help, but then it damages other namespaces. i'm sorry i didn't write about other namespaces before, i thought fixing xmlns declaration wouldn't affect other namespaces.
Back to top
View user's profile Send private message
bhaski
PostPosted: Fri Feb 23, 2007 2:52 pm    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Hi friends

do you have the answer for this issue ? I am also suffering with this issue on Namespace declaration in XMLNSC?



Bhaski.
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 » problems with namespace
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.