You are not logged in.
Announcement
Unanswered posts
|

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
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
Offline

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

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