Page 1 of 1

passing value as tag in xml

Posted: Mon Oct 16, 2006 5:51 am
by sravanthi
Hi

I have a scenario where i have to pass the value of a column as tag dyanamically.

ex:

name values(abcd,xyz)
id values(11,22)

expected output should be
<work>
<abcd>
11
</abcd>
</work>
<work>
<xyz>
22
</xyz>
</work>

I have given tags as :
/root/work/@name
/root/work/value/text()

I'm getting the output as :
<work>
<name ="abcd">
<value>
11
</value>
</name>
<name ="xyz">
<value>
22
</value>
</name>
</work>

Can anyone suggest some solution for this!

thanks!

Posted: Mon Oct 16, 2006 6:25 am
by chulett
Those are XPath Expressions not 'tags' that generate the XML output in your job. And you get the 'name = "xxx"' elements because of the use of the '@'.

I'm not positive you can generate output like that without doing your own 'tag building' or XML creation. What I would suggest you try is to take a sample output file you've built (or better yet an .xsd if you have one) and import the metadata for it via the Manager. See what kind of XPath Expressions it creates for the file and try those in your job.