Page 1 of 1

XPath problem when transforming flat file to XML

Posted: Wed Aug 09, 2006 12:59 pm
by Daniel Zackrisson
Hello!

I work on a data migration project and try to convert data from a tabular file to an XML-format. When I run my job i extract a row from the table like the second line below:

TYPE,level_type1,LINE,level_type2
C,1,AC,2

And want to create an XML output like this:

<Product_class>
<name>C</name>
<level_type>1</level_type>
</Product_class>
<Product_class>
<name>AC</name>
<level_type>2</level_type>
</Product_class>

I did this by generating XPath expressions in the XMLmetadataimporter.exe and load the table definitions into the XML output stage, the column tab like this:

Column name,.......................,Description
TYPE,....................................,/Product_class/name/text()
level_type1,..........................,/Product_class/level_type/text()
LINE,.....................................,/Product_class/name/text()
level_type2,..........................,/Product_class/level_type/text()

The output I get is:

<Product_class>
_<name>C AC </name>
_<level_type>1 2</level_type>
</Product_class>

Does anyone knows the correct way to write the X-Paths?

/Dan

Re: XPath problem when transforming flat file to XML

Posted: Mon Aug 20, 2007 8:03 am
by Aquilis
Hello All,
Does anybody got any workaround for this kind of XML file generation.
If so, let me know. i am also facing same kind of problem.

Thanks in advance.

Posted: Mon Aug 20, 2007 8:16 am
by chulett
'Same kind of problem' doesn't cut the mustard. Start a new post. Link back to this post if you think it will help, but tell us exactly what your problem is, not that it's similar to this one. :?