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 » Problem with XMLNS namespace prefixes

Post new topic  Reply to topic
 Problem with XMLNS namespace prefixes « View previous topic :: View next topic » 
Author Message
GSnyder13
PostPosted: Fri Apr 29, 2005 5:25 am    Post subject: Problem with XMLNS namespace prefixes Reply with quote

Novice

Joined: 29 Mar 2005
Posts: 13
Location: United States

I need to create the following XML(We are using WBIMB v5):

<?xml version="1.0" encoding="UTF-8"?>
<admin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="csm_admin.xsd">

Here is my ESQL code:

CREATE COMPUTE MODULE Manugistics_Common_Security_Enterprise_Reformat_Compute
CREATE FUNCTION main() RETURNS BOOLEAN
BEGIN

-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
-- Set some message format settings in the MQMD
DECLARE publicationHeaderReference REFERENCE TO InputRoot.XML.llbeanDocument.document.publication.publicationHeader;
DECLARE inRef REFERENCE TO InputRoot.XML."llbeanDocument"."document"."publication"."publicationBody"."vendor";
DECLARE typeDesc REFERENCE TO InputRoot.XML."llbeanDocument"."document"."publication"."publicationHeader"."publicationTypeDesc" ;

SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQMD.Encoding = MQENC_NATIVE;
SET OutputRoot.MQMD.Format = MQFMT_STRING;
SET OutputRoot.MQMD.CodedCharSetId = MQCCSI_Q_MGR;

--xml declaration ----------------------------------------------------------------------------
SET OutputRoot.XMLNS.(XML.XmlDecl) = '';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML."Encoding") = 'UTF-8';
----------------------------------------------------------------------------------------------
DECLARE manu_sp NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';

-- Create admin
----------------------------------------------------------------------------------------------------------------;
SET OutputRoot.XMLNS.admin.(XML.NamespaceDecl)manu_sp:noNamespaceSchemaLocation = 'csm_admin.xsd';
----------------------------------------------------------------------------------------------------------------
SET OutputRoot.Properties.MessageDomain = 'XMLNS';

Here is my output:

<?xml version="1.0" encoding="UTF-8" ?>
- <admin xmlns:NS1="http://www.w3.org/2001/XMLSchema-instance" NS1:noNamespaceSchemaLocation="csm_admin.xsd">

Does anyone know how to make the "NS1" say "xsi" instead? The instructions in the IBM ESQL manual for XMLNS are not very good. When I reference SET OutputRoot.XMLNS.admin.(XML.NamespaceDecl)xmlns:noNamespaceSchemaLocation = 'csm_admin.xsd';

I get an error saying "Namespace constant xmlns has not been defined".

Any help would be greatly appreciated.

Thanks.

Gene Snyder
Back to top
View user's profile Send private message
nathanw
PostPosted: Fri Apr 29, 2005 5:52 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

whenever i have to wriet out in XMLNS i always include the following code at the beginning

Code:

DECLARE xmlns NAMESPACE 'urn:hl7-org:v3';
DECLARE xsi NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';

SET "OutputRoot"."XMLNS"."xxxxxxx".(XML.NamespaceDecl)xmlns:space1 = 'urn:hl7-org:v3';
SET "OutputRoot"."XMLNS"."xxxxxxx".xmlns:data1 = 'http://www.w3.org/2001/XMLSchema-instance';


See if that helps
Back to top
View user's profile Send private message MSN Messenger
alexey
PostPosted: Sat Apr 30, 2005 12:46 am    Post subject: Reply with quote

Acolyte

Joined: 18 Dec 2003
Posts: 62
Location: Israel

Hi,
Check if this helps:

http://www.mqseries.net/phpBB2/viewtopic.php?t=21407&highlight=xsi
Back to top
View user's profile Send private message
GSnyder13
PostPosted: Sat Apr 30, 2005 5:13 am    Post subject: Thanks, but... Reply with quote

Novice

Joined: 29 Mar 2005
Posts: 13
Location: United States

Thank you both for your responses, but I still can't get the "NS1" to say "xsi":

<admin xmlns:NS1="http://www.w3.org/2001/XMLSchema-instance" NS1:noNamespaceSchemaLocation="csm_admin.xsd">

According to the ESQL manual for WBIMB Messagebroker, v5, "Manipulating messages in the XMLNS domain": "If, when the output message is generated, the namespace with which an element or attribute is qualified has no corresponding namespace declaration, one is qutomatically generated using prefixes of the form NSn where n is a positive integer".

No matter how I code this, nothing changes. NS1 is always coming up as the default prefix. I don't get it...

This is very frustrating and if anyone from IBM is monitoring these postings, I think an explanation is in order. These things seem to be more complicated than they need to be considering all of the postings I am seeing relative to namespaces, prefixes, and XMLNS. The ESQL manual for WBIMB v5 is not very clear. I have actually tried the exact same code that is in the manual from "Manipulating messages in the XMLNS domain" and I get a warning saying "xmlns" is not a namespace constant. Has anyone else experienced this?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sat Apr 30, 2005 5:43 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Upgrade to FP4 or FP5.

I remember seeing a bug here about namespace declarations.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Diwakar
PostPosted: Fri May 13, 2005 2:00 pm    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2005
Posts: 33

I am facing the same problem.....I am using WBIMB v5 CSD4.

Has anybody found a solution to this problem ??

Please let me know.

Thanks.
Back to top
View user's profile Send private message
GSnyder13
PostPosted: Sat May 14, 2005 3:25 am    Post subject: Namespace - XMLNS Reply with quote

Novice

Joined: 29 Mar 2005
Posts: 13
Location: United States

My problem was really due to a misunderstanding regarding warnings issued by the broker. When I code this (where 'manu_sp' can be anything you want it to be):

DECLARE manu_sp NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';

SET OutputRoot.XMLNS.admin.(XML.NamespaceDecl)xmlns:noNamespaceSchemaLocation = 'csm_admin.xsd';

The editor that does the syntax check will issue a warning that "Namespace constant xmlns has not been defined". "xmlns" is a constant, but it apparently is not visible to the syntax checker in the ESQL editor. This warning is just that---a warning. When the ESQL is saved, deployed, and tested, you WILL get this as output:

<admin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="csm_admin.xsd">

I take back my disparaging remarks about the code not working. It DOES work. What the manual doesn't address is the issue about warnings and the constant 'xmlns' not being visible to the syntax checker in the broker when editing the ESQL.
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 » Problem with XMLNS namespace prefixes
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.