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 » remove namespace from xml message

Post new topic  Reply to topic
 remove namespace from xml message « View previous topic :: View next topic » 
Author Message
sanketpatel
PostPosted: Tue Nov 21, 2006 4:57 am    Post subject: remove namespace from xml message Reply with quote

Apprentice

Joined: 31 Oct 2006
Posts: 40

Hi,

my input message is like this:


<DataElement>
<NS1:sap_zv_prodn_bal_mvmnt_data
xmlns:NS1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/sap_zv_prodn_bal_mvmnt_data"
xmlns:NS2="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/sap_prdbalmvmntdata"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Plant>1121</Plant>
<MatDesc>MOTOR SPIRIT 87 ON (Unleaded MS)</MatDesc>
<MatCode>16000</MatCode>
</NS1:sap_zv_prodn_bal_mvmnt_data>
</DataElement>

and i want output like this:

<DataElement>
<Plant>1121</Plant>
<MatDesc>MOTOR SPIRIT 87 ON (Unleaded MS)</MatDesc>
<MatCode>16000</MatCode>
</DataElement>

i tried this...

DECLARE NS1 NAMESPACE 'http://www.ibm.com/websphere/crossworlds/2002/BOSchema/sap_zv_prodn_bal_mvmnt_data';
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
set OutputRoot.XML.DataElement = InputRoot.XML.NS1:sap_zv_prodn_bal_mvmnt_data;

but i am getting and xml writing error.
Back to top
View user's profile Send private message
nathanw
PostPosted: Tue Nov 21, 2006 5:04 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

You are using the XMLNS domain I assume.

If you carry out changes to teh message and do not inlcude a declaration then it will fail as no namespace declaration is read.

After the Input node insert a Reset Content Descriptor node and switch it to XML then rebuild your message in esql etc.
_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
sanketpatel
PostPosted: Tue Nov 21, 2006 5:32 am    Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2006
Posts: 40

sorry i am not getting u..

pls come again...
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 21, 2006 5:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can't do namespaces when you use XML domain, you must use XMLNS or XMLNSC.

If you do a search here, you can find a couple of different pieces of code for removing namespaces from a tree. At least one of those pieces of code is not very good, so use some caution.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sanketpatel
PostPosted: Tue Nov 21, 2006 5:53 am    Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2006
Posts: 40

hey..

i am very much new with the esql.

if anyone can write small example it will be a great help.

thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 21, 2006 6:20 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you do a search here, you will find an example.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sanketpatel
PostPosted: Tue Nov 21, 2006 6:57 am    Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2006
Posts: 40

pls point me to that post....

i am not able to find...
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 21, 2006 7:02 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Search for "remove namespaces", in this forum, for all words.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Nov 21, 2006 7:22 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

- First, change to the XMLNSC domain. Don't use XML.
- Read this : http://www.mqseries.net/phpBB2/viewtopic.php?t=25039
- Modify the stripNamespaces procedure so that it works for the XMLNSC domain.
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 » remove namespace from xml message
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.