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 » How Add xmlns:xs,xmlns:xsi,xsi:schemaLocation Using JavaCmpN

Post new topic  Reply to topic
 How Add xmlns:xs,xmlns:xsi,xsi:schemaLocation Using JavaCmpN « View previous topic :: View next topic » 
Author Message
Ranodip Basu
PostPosted: Thu Nov 02, 2006 11:03 pm    Post subject: How Add xmlns:xs,xmlns:xsi,xsi:schemaLocation Using JavaCmpN Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi All,

We have got a requirement where we need to include some xml namespace values to the message as in below:

Quote:
<?xml version="1.0" encoding="UTF-8" ?>
- < OrganizationCodes xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://operations.com/Fin-I-006/OrganizationCodes/NOV2005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://operations.com/Fin-I-006/OrganizationCodes/NOV2005 ../schemas/http___operations.com_Fin-I-006_OrganizationCodes_NOV2005.xsd">


Here OrganizationCodes is the root element of the xml message and we have to have use JavaCompute node for this purpose. I am posting the Java code we have written to set the xml namespace :

Quote:
MbElement OutRoot = outMessage.getRootElement();
MbElement OutBody = OutRoot.createElementAsLastChild("XMLNS");
MbElement currencyCodes = OutBody.createElementAsFirstChild(MbElement.TYPE_NAME,"OrganizationCodes","");
currencyCodes.setNamespace("http://www.w3.org/2001/XMLSchema");


Which is giving the output as :

Quote:
<NS1:OrganizationCodes xmlns:NS1="http://www.w3.org/2001/XMLSchema">


Now I have only get setNamespace() method for working with spaceNamespace for MbElement.

Could anybody please help me out how to add the values of xmlns:xs,xmlns:xsi, xsi"schemaLocation etc to the xml root element OrganizationCodes ?

Thanks & Regards,
Ranodip Basu
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Nov 03, 2006 3:24 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Did you read this?
It is still valid when you switch development language...
Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Ranodip Basu
PostPosted: Fri Nov 03, 2006 3:57 am    Post subject: Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi fjb_saper,

Thanks for your reply. Actually I have already seen this piece. But I am got stuck how to replace ESQL line

[quote]SET OutputRoot.XMLNS.message.sp2:data2.(XML.NamespaceDecl)xmlns = 'http://www.ibm.com/space2';[/quote]

by Java to get the output

[quote]<message xmlns:space1="http://www.ibm.com/space1">[/quote]

Because I believe to add the namespace in a XML element by java, we need to use MbElement object which only has setNamespace() method for this purpose.

Could you please help me out ?

regards,
Ranodip basu
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 03, 2006 4:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Please use XMLNSC with WMB v6.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/com/ibm/broker/plugin/MbXMLNSC.html

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/as08560_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac26040_.htm

Otherwise, those various things are going to be children of OrginzationCodes with various specific types. See the MBElement.setSpecificType().
_________________
I am *not* the model of the modern major general.
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 » How Add xmlns:xs,xmlns:xsi,xsi:schemaLocation Using JavaCmpN
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.