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 » Using ESQL to get XML Property Set ?

Post new topic  Reply to topic
 Using ESQL to get XML Property Set ? « View previous topic :: View next topic » 
Author Message
Djeyli
PostPosted: Mon Jul 08, 2002 6:46 am    Post subject: Using ESQL to get XML Property Set ? Reply with quote

Apprentice

Joined: 03 Apr 2002
Posts: 28
Location: New Zealand

Hi all

I am VERY new to ESQL and have a bit of a problem. I have looked thru the literature, but as many of you know it is not all that friendly !!

I have an XML Input file like this:

<Mercedes>
<vehicle MessageID="1B-3RG" Service="Breakdown" Person="JSmith"/>
</Mercedes>

I need the following as output:

<ContactPerson>JSmith</ContactPerson>

I need to know how to do this in the ESQL for example :

SET OutputRoot.XML."ContactPerson" = InputRoot.XML. ??? ;

I am sure its pretty easy, but I can't find it anywhere !

Thanks
J
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
kirani
PostPosted: Mon Jul 08, 2002 7:15 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Try this,

SET OutputRoot.XML.ContactPerson = InputRoot.XML.Mercedes.vehicle.(XML.Attribute)Person;
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Djeyli
PostPosted: Mon Jul 08, 2002 11:36 pm    Post subject: Not quite right Reply with quote

Apprentice

Joined: 03 Apr 2002
Posts: 28
Location: New Zealand

Hi Kiran

It hasn't worked quite right. I am getting the information as an attribute in my final file. Eg:

<Dealer ContactPerson="JSmith">
</Dealer>

Where it should be:

<Dealer>
<ContactPerson>JSmith</ContactPerson>
</Dealer>

Regards
J
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
kirani
PostPosted: Tue Jul 09, 2002 7:42 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi J,

Use this,
DECLARE CPerson CHAR;
SET CPerson = InputRoot.XML.Mercedes.vehicle.(XML.Attribute)Person;
SET OutputRoot.XML.Dealer.ContactPerson = CPerson;
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
mpuetz
PostPosted: Tue Jul 09, 2002 8:42 am    Post subject: Reply with quote

Centurion

Joined: 05 Jul 2001
Posts: 149
Location: IBM/Central WebSphere Services

Hi,

the recommended way of getting rid of the attribute in WMQI 2.1 is
to use the VALUE = statement.

SET OutputRoot.XML.Dealer.ContactPerson VALUE = InputRoot.XML.Mercedes.vehicle.(XML.Attribute)Person;

Explanation:
The normal assignment = does an assignment both to element VALUE and TYPE.
If you don't qualify the element with e.g. (XML.Element) or (XML.Attribute) (or others) MQSI matches on element name only:
- for reading InputRoot.XML.Mercedes.vehicle.Person
would give you the first element below vehicle with Name Person.
In your case it would find (XML.Attribute)Person
- for writing, if the element does not exist it creates a new one with
the given name and the type of the element on the right hand side.
If no type is given, the XML parser creates an element of type
(XML.Element)
_________________
Mathias Puetz

IBM/Central WebSphere Services
WebSphere Business Integration Specialist
Back to top
View user's profile Send private message
Djeyli
PostPosted: Wed Jul 10, 2002 1:16 am    Post subject: Thanks Reply with quote

Apprentice

Joined: 03 Apr 2002
Posts: 28
Location: New Zealand

Hi Kiran, Mathias

Thanks for the help !
Both ways work perfectly !

Regards
J
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Using ESQL to get XML Property Set ?
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.