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 » XMLNS namespace prefix not to be present at each element

Post new topic  Reply to topic
 XMLNS namespace prefix not to be present at each element « View previous topic :: View next topic » 
Author Message
sknrt1
PostPosted: Thu Oct 04, 2007 4:48 pm    Post subject: XMLNS namespace prefix not to be present at each element Reply with quote

Apprentice

Joined: 22 Jan 2003
Posts: 39
Location: USA

I am trying to create an output xml as below:
-----------
<?xml version="1.0" encoding="UTF-8"?>
<a:b xmlns:a="http://test.com">
<item>
<iNo>i1</iNo>
<iP>1.0</iP>
</item>
<item>
<iNo>i2</iNo>
<iP>2.0</iP>
</item>
</a:b>
------------

But with the ESQL code, the o/p is as follows,
----------
<?xml version="1.0" encoding="UTF-8"?>
<a:b xmlns:a="http://test.com">
<a:item>
<iNo>i1</iNo>
<iP>1.0</iP>
</a:item>
<a:item>
<iNo>i2</iNo>
<iP>2.0</iP>
</a:item>
</a:b>
----------

here is the esql code:
-----------
DECLARE ns NAMESPACE 'http://test.com';

SET OutputRoot.XMLNS.ns:b.(XML.NamespaceDecl)xmlns:a='http://test.com';

SET OutputRoot.XMLNS.ns:b.ns:item[] = EV.RS[];

here EV.RS[] has resultset from database.
-----------

is it possible to have the prefix not added to element "item" (<a:item>), just have it added at the top.

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Oct 04, 2007 5:12 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Code:
SET OutputRoot.XMLNS.ns:b.item[] = EV.RS[];

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sknrt1
PostPosted: Fri Oct 05, 2007 4:48 am    Post subject: Reply with quote

Apprentice

Joined: 22 Jan 2003
Posts: 39
Location: USA

Jeff, Thanks for the quick response.

Regards,
sknrt1
_________________
------------------------------------------
sk
MQ User since 2001
Message Broker User since 2001

IBM Certified
Solution Designer - WebSphere MQ
Solution Developer - Message Broker
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 » XMLNS namespace prefix not to be present at each element
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.