Page 1 of 1

Working with XML

Posted: Thu Oct 28, 2010 6:46 am
by Harini
Hello All,

I am trying to read from a xml file and load the data into SQL Server.

My job design is as follows.

External Source Stage -> XML Input Stage -> Transformer -> ODBC

Here, the problem is the data in table is entered along with the XML Tags :(

Eg: <Name>Meena</Name>
<DOB> 21121986 </DOB>

In the target table columns are Name, and DOB. The data entered looks like
Name, DOB
<Name>Meena</Name>, <DOB> 21121986 </DOB>

Please help on how to remove the tags in the target data

Thanks

Posted: Thu Oct 28, 2010 7:28 am
by eostic
Look at the output link of your XML Input Stage.....go to the Descriptions of each column..... chances are, the elements you are retrieving are missing the final /text() from the xpath syntax. Without the "text()" it means "get the whole element".......

....so it should be .../.../.../DOB/text() ...and so forth.

Ernie

Re: Working with XML

Posted: Thu Oct 28, 2010 7:29 am
by samyamkrishna
while giving the XPATH derivations

give /Name/text() and /DOB/text().

this will get only teh data and no tags.

Posted: Thu Oct 28, 2010 8:47 am
by Harini
eostic wrote:Look at the output link of your XML Input Stage.....go to the Descriptions of each column..... chances are, the elements you are retrieving are missing the final /text() from the xpath syntax. Without the "text()" it means "get the whole element".......

....so it should be .../.../.../DOB/text() ...and so forth.

Ernie
Thanks a lot friends ! It worked ! :)