|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL Help Needed |
« View previous topic :: View next topic » |
Author |
Message
|
v_venugopalan |
Posted: Wed Dec 03, 2003 8:27 pm Post subject: ESQL Help Needed |
|
|
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 |
|
 |
EddieA |
Posted: Thu Dec 04, 2003 12:29 am Post subject: |
|
|
 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 |
|
 |
v_venugopalan |
Posted: Thu Dec 04, 2003 1:44 am Post subject: |
|
|
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 |
|
 |
EddieA |
Posted: Thu Dec 04, 2003 7:04 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|