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 » ESQL Help Needed

Post new topic  Reply to topic
 ESQL Help Needed « View previous topic :: View next topic » 
Author Message
v_venugopalan
PostPosted: Wed Dec 03, 2003 8:27 pm    Post subject: ESQL Help Needed Reply with quote

Novice

Joined: 25 Nov 2003
Posts: 12
Location: INDIA

Hi Friendz...

I have a Specific Requirement in XML Transformation Using EQL Compute Node.

I have to Convert the Following XML
Quote:
<Data>
<Transaction>1234</Transaction>
<Table>Employee</Table>
<PrimaryKey>Name</PrimaryKey>
<Column>Address</Column>
<Value>US</Value>
<Transaction>5678</Transaction>
<Table>Employee1</Table>
<PrimaryKey>Name1</PrimaryKey>
<Column>Address1</Column>
<Value>UK</Value> .........
</Data>


into the following Format
Quote:

<Employee PrimaryKey="Name">
<Address Value ="US"></Address>
</Employee>
<Employee1 PrimaryKey="Name1">
<Address1 Value ="UK"></Address1>
</Employee1> ...........


I donno How to Convert the Element Values into A New Element Tag and Attributes...
Also I tried with the Following

Quote:
(XML.Element) , (XML.Attribute), (XML.Content)


to get the Transformation..But It did not work Out...

I donno Whether we can use this or the Way in which i frame my
outputRoot is wrong..

Can anyone say How to use these commands (Exact Syntax) or how to Transform the Input XML to Output XML..
Also How to Loop through to get the Multiple Transformation

Thanx in Advance
_________________
VV
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Dec 04, 2003 12:29 am    Post subject: Reply with quote

Jedi

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

Lets see. Firstly, the way the input repeats is a little strange, so the following may not be 100%. (Especially as I'm writing it from memory).

Also, do you really want to change the value of the output tag based on it's occurance: Employee, Employee1, etc. If so, then this code would need changing to do 'run time' evaluation of the tag name using {} or EVAL. (Having the 1st one as Employee, and subsequent ones as EmployeeN might be a challenge ).

CARDINALITY(InputBody.Data.Transaction[]) will count how many there are to use as a loop counter.

Code:
SET OutputRoot.XML.Employee[n].(XML.Attibute)PrimaryKey = InputBody.Data.PrimaryKey[n]
SET OutputRoot.XML.Employee[n].Address(XML.Attibute)Value = InputBody.Data.Value[n]


Should solve the Attribute question, where n is the current loop position. But, as I said before, this hasn't been tested.

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
v_venugopalan
PostPosted: Thu Dec 04, 2003 1:44 am    Post subject: Reply with quote

Novice

Joined: 25 Nov 2003
Posts: 12
Location: INDIA

Hi

That is Just an Example I gave; It need not Repeat as Employee,Employee1 etc, It can be Different...

Also U have not answered Me how to set the Element Name as Employee or Employee1 etc etc


Thanx
_________________
VV
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Dec 04, 2003 7:04 am    Post subject: Reply with quote

Jedi

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

Quote:
Also, do you really want to change the value of the output tag based on it's occurance: Employee, Employee1, etc. If so, then this code would need changing to do 'run time' evaluation of the tag name using {} or EVAL.


You didn't say what version, so if you're still on 2.0.2 you'll have to use EVAL.

Code:
SET OutputRoot.XML.{Employee || n}.(XML.Attibute)PrimaryKey = InputBody.Data.PrimaryKey[n]


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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ESQL Help Needed
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.