#1 2011-11-03 20:40:16

praveenk
Member
Registered: 2010-12-07
Posts: 53

Exprestion

Tags: [db2, oracle]

Hi,

I am new to using a talend sudio..I have a senario to implement in Talend Studio.

I have a XML code, I have to mask ( LoginAccountIdentifier=" " ) only that portion of the string and then map the string to the column.

Example: <p:REQUEST InternalAccountIdentifier="testintaccount " LoginAccountIdentifier="testloginaccount" LoginAccountPassword="test password" RequestDateTime="2011-11-02T17:38:59-04:00">

I would like to map this string to taget like this :

<p:REQUEST InternalAccountIdentifier="testintaccount  " LoginAccountIdentifier="" LoginAccountPassword="" RequestDateTime="2011-11-02T17:38:59-04:00">

Please help me on the exprestion.

Thank you,
Praveen

Offline

#2 2011-11-04 03:32:13

shong
Talend team
Registered: 2007-08-29
Posts: 10305
Website

Re: Exprestion

Hi Praveen

Not sure i understand you well, read all the nodes using tFileInputXML, replace some value with empty string "" on tMap and write them into a new xml file suing tFileOutputXML.

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2011-11-04 14:17:26

praveenk
Member
Registered: 2010-12-07
Posts: 53

Re: Exprestion

Hi Shong,

I have a source database, one column has in XML code. This XML code migrate to Target database column. So we need to to mask on ( LoginAccountIdentifier=" " and LoginAccountPassword =' ')insert to target column.

Source Database Cloumn RQST_PARM:
                                                                                                                                                                                                                                                                                               <p:REQUEST InternalAccountIdentifier="testintaccount " LoginAccountIdentifier="testloginaccount" LoginAccountPassword="test password" RequestDateTime="2011-11-02T17:38:59-04:00">

TargetDatabaseCloumnRQST_PARM    :
                                                                                                                                                                                                                                                                                               <p:REQUEST InternalAccountIdentifier="testintaccount " LoginAccountIdentifier=" " LoginAccountPassword=" " RequestDateTime="2011-11-02T17:38:59-04:00">

I hope you can undastand now. Please help me to write a exprestion.

Thank you,
Praveen

Offline

#4 2011-11-04 21:17:24

ashu
Member
Registered: 2010-07-14
Posts: 133

Re: Exprestion

Praveen, try using the tExtractXMLField Component.  but u need a namespace bound to 'P':
what I understand from u r question is .. you are trying to check the values of LoginAccountIdentifier and LoginAccountPassword .. if they are empty you want to insert that XML data to new DB column.. is that right?

if so  .. follow the below steps.
if you don't have a name space in your DB column, and if you don't care about the P:  try to replace that with an empty character.

create a job something like below.
DBInputComponent-> tJavarow -> tExtractXMLfield -> tMap -> dbOutputComponent.

in tJavRow save the XML field to a context variable. and then replace the P: with "" (empty String)  then pass that String to tExtractXML component,. get extracted the required fields then in tMap create a condition and if that is TRUE assign the Context param to the output Row,.  if you dont get an idea, you can mail me.

Offline

Board footer

Powered by FluxBB