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 » XML ATTRIBUTE

Post new topic  Reply to topic
 XML ATTRIBUTE « View previous topic :: View next topic » 
Author Message
mahek
PostPosted: Fri Mar 18, 2005 7:52 am    Post subject: XML ATTRIBUTE Reply with quote

Voyager

Joined: 10 Sep 2004
Posts: 87

Hi all,
I have the following problem i want the XML in this format.

<Product>
<contract>
<Field NAME="proprietary">Yes</Field>
<Field NAME="proprietaryRestricted">No</Field>
</contract>
</Product>

I am writing the folowing esql code inside my compute node.


Set OutputRoot.XML.Product.contract.Field.(XML.attr)NAME = 'proprietary';
SET OutputRoot.XML.Product.contract.Field='Yes';
Set OutputRoot.XML.Product.contract.Field.(XML.attr)NAME = 'proprietaryRestricted';
SET OutputRoot.XML.Product.contract.Field='No';

I am getting the following output for this code

<Product>
<contract>
<Field NAME="proprietaryRestricted">No</Field>
</contract>
</Product>

can any one tell me how to achive the desired output.
Thanks in advance
Back to top
View user's profile Send private message
JT
PostPosted: Fri Mar 18, 2005 7:58 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Code:
Set OutputRoot.XML.Product.contract.Field[1].(XML.attr)NAME = 'proprietary';
SET OutputRoot.XML.Product.contract.Field[1]='Yes';
Set OutputRoot.XML.Product.contract.Field[2].(XML.attr)NAME = 'proprietaryRestricted';
SET OutputRoot.XML.Product.contract.Field[2]='No';
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Mar 18, 2005 7:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

ESQL doesn't have arrays.

It has tree references that look like arrays.

Put [1] and [2] after Field in your SET statements.

And please read the documentation and strongly consider getting some training.
_________________
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 » XML ATTRIBUTE
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.