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 » Information regarding XMLNS Domain

Post new topic  Reply to topic
 Information regarding XMLNS Domain « View previous topic :: View next topic » 
Author Message
satyasheel15
PostPosted: Mon Nov 22, 2004 3:12 am    Post subject: Information regarding XMLNS Domain Reply with quote

Voyager

Joined: 04 Mar 2003
Posts: 86

subrpaul@in.ibm.co... Hi,

I am having a typical problem. I need to get an XMLNS output using messagedomain as XMLNS as follows
--------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2005 U (http://www.xmlspy.com)-->
<n:transaction xmlns:n="http://www.lsb.de/apc/ops/Transaction" xmlns:ops="http://www.lsb.de/apc/ops/Ops" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.lsb.de/apc/ops/Transaction
C:\PROGRA~1\IBM\WEBSPH~2\eclipse\workspace\LHS_Schemas_XSDs\ops\Transaction.xsd">

I have written the following code ................

-- Declare namespaces for TRANSACTION
DECLARE sp1 NAMESPACE 'http://www.lsb.de/apc/ops/Transaction';
DECLARE sp2 NAMESPACE 'http://www.lsb.de/apc/ops/Ops';
DECLARE sp3 NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';


-- Declare namespaces for PAXDETAILS
DECLARE sp4 NAMESPACE 'http://www.lsb.de/apc/ops/paxDetail';
DECLARE sp5 NAMESPACE 'http://www.lsb.de/apc/IATA/SSIM';

DECLARE sp6 NAMESPACE 'http://www.lsb.de/apc/ops/Transaction/ops/Transaction.xsd';

SET OutputRoot.XMLNS."n:transaction".(XML.NamespaceDecl)xmlns:n = sp1;

SET OutputRoot.XMLNS."n:transaction".(XML.NamespaceDecl)xmlns:ops = sp2;

SET OutputRoot.XMLNS."n:transaction".(XML.NamespaceDecl)xmlns:xsi = sp3;


SET OutputRoot.XMLNS."n:transaction".(XML.NamespaceDecl)xsi:schemaLocation = sp6;

And my output is comung as follows ...........

<n:transaction xmlns:n="http://www.lsb.de/apc/ops/Transaction" xmlns:ops="http://www.lsb.de/apc/ops/Ops" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:NS1="xsi" NS1:schemaLocation="http://www.lsb.de/apc/ops/Transaction/ops/Transaction.xsd">

The problem is .......
I need to add an attribute named "xsi:schemaLocation" to my toplevel element transaction, but while doing so by above code defaullt namespace "NS1" is geeting attached to both "xsi" and "schemaLocation".

Can anybody tell me how can I create the "xsi:schemaLocation" attribute in my top level element.


SATYASHEEL

IBM Calcutta
Back to top
View user's profile Send private message Send e-mail MSN Messenger
juddg
PostPosted: Mon Nov 22, 2004 6:17 am    Post subject: Reply with quote

Apprentice

Joined: 22 Nov 2004
Posts: 33

Satyasheel,
The problem is that xsi:schemaLocation is not a namespace declaration it is just an attribute. The following ESQL should produce what you require.

Regards,

Geoff.

-- Declare namespaces for TRANSACTION
DECLARE sp1 NAMESPACE 'http://www.lsb.de/apc/ops/Transaction';
DECLARE sp2 NAMESPACE 'http://www.lsb.de/apc/ops/Ops';
DECLARE sp3 NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';


-- Declare namespaces for PAXDETAILS
DECLARE sp4 NAMESPACE 'http://www.lsb.de/apc/ops/paxDetail';
DECLARE sp5 NAMESPACE 'http://www.lsb.de/apc/IATA/SSIM';

DECLARE schemaLoc CONSTANT CHARACTER 'http://www.lsb.de/apc/ops/Transaction C:\PROGRA~1\IBM\WEBSPH~2\eclipse\workspace\LHS_Schemas_XSDs\ops\Transaction.xsd';

SET OutputRoot.XMLNS."n:transaction".(XML.NamespaceDecl)xmlns:n = sp1;

SET OutputRoot.XMLNS."n:transaction".(XML.NamespaceDecl)xmlns:ops = sp2;

SET OutputRoot.XMLNS."n:transaction".(XML.NamespaceDecl)xmlns:xsi = sp3;


SET OutputRoot.XMLNS."n:transaction".(XML.Attribute)sp3:schemaLocation = schemaLoc;
[/code]
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 » Information regarding XMLNS Domain
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.