|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How Add xmlns:xs,xmlns:xsi,xsi:schemaLocation Using JavaCmpN |
« View previous topic :: View next topic » |
Author |
Message
|
Ranodip Basu |
Posted: Thu Nov 02, 2006 11:03 pm Post subject: How Add xmlns:xs,xmlns:xsi,xsi:schemaLocation Using JavaCmpN |
|
|
 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 |
|
 |
fjb_saper |
Posted: Fri Nov 03, 2006 3:24 am Post subject: |
|
|
 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 |
|
 |
Ranodip Basu |
Posted: Fri Nov 03, 2006 3:57 am Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Fri Nov 03, 2006 4:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|