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 » Checking the value of XML attribute

Post new topic  Reply to topic
 Checking the value of XML attribute « View previous topic :: View next topic » 
Author Message
Meow
PostPosted: Mon Dec 15, 2003 7:19 am    Post subject: Checking the value of XML attribute Reply with quote

Voyager

Joined: 25 Jun 2003
Posts: 95

Hi All,

how do i check the value of an xml attribute.. say i have

<query>
<node value-type="DATE">JOINDATE</node>
<node>12/15/2003</node>
</query>

DECLARE myRef REFERENCE TO InputRoot.XML.query

IF(myRef.node[1].(XML.Attribute)"value-type" = 'DATE') then
----
end if;

The above If statement doesnot work properly. can you give me the correct ESQL syntax.

Thanks.
Paruvan
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Dec 15, 2003 10:07 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Do you even need the (XML.Attribute) when 'reading' a value. Here's some actual working code:

Code:
SET OutputRoot.XML.WorkOrder.Premises.(XML.Attribute)MeterLocation = InputLocalEnvironment.ACI.AMWO_ROUTE_ORDER.AMWO_METER_LOC;
...
...
SET OutputRoot.XML.WorkOrder.WorkOrderDetail.(XML.Attribute)MeterLocation = OutputRoot.XML.WorkOrder.Premises.MeterLocation;


Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
Meow
PostPosted: Mon Dec 15, 2003 1:48 pm    Post subject: Reply with quote

Voyager

Joined: 25 Jun 2003
Posts: 95

i need to check the value of attribute to take decision on some of the things.
Thanks for your input.


supose say i want to insert date into the database and i get an XML string

<node value-type="DATE">2003-12-15</node> . since its a date i have to make a insert statement as

insert into table values('2003-12-15');

can some one tell me how do i insert ' coz when i retrieve the element value it gives me something like 2003-12-15 but to perform database operation and since its of type date i need to add ' on either side.

Please let me know.
Thanks
Paruvan
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Dec 15, 2003 5:50 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

OK, you've changed the XML, so this is based on the last one you gave:
Code:
DECLARE WorkDate CHARACTER;

IF InputBody.query.node."value-type" = 'DATE' THEN
  SET WorkDate = '''' || InputBody.query.node || '''';
END IF;


You can then use WorkDate, which contains the input date surrounded by single quotes.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
Meow
PostPosted: Mon Dec 15, 2003 6:12 pm    Post subject: Reply with quote

Voyager

Joined: 25 Jun 2003
Posts: 95

Thanks alot it works.
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 » Checking the value of 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.