Using HTML tag on xml file from txmlmap

Seven Stars

Re: Using HTML tag on xml file from txmlmap

So I try , Its showing the xml file with the tag, working.PNG

but I'm using a tFileInputXML and I get the xml file with

((String)globalMap.get("tFileList_1_CURRENT_FILE"))

So I try this one helpos.PNGtest.PNGAnd I don't get the <p> tag her

 

I used my XPath query

"my:DATA/my:Description/html"

Idk why it doest work  Smiley Sad

 

And I think its a little be boring for you... sorry...

Community Manager

Re: Using HTML tag on xml file from txmlmap

Don't use the tFileInputXML for this. You do not need to. Just replace your section of the job which starts with the tFileInputXML component with the components I showed you.

Seven Stars

Re: Using HTML tag on xml file from txmlmap

But I have many file (maybe 200 per job execution) and I need to read all file, how can I read all file from my directory ?

Community Manager

Re: Using HTML tag on xml file from txmlmap

I don't understand why this is changing the reading of files? Just replace the section that starts with the tFileInputXML and replace it with the job section I gave you. You are still reading the file, just with a different component.

 

EDIT: Hang on, do you think that 

((String)globalMap.get("tFileList_1_CURRENT_FILE"))

is passing the XML to the component? It isn't. It is passing the file path and name to the component. The component then reads the file.

Seven Stars

Re: Using HTML tag on xml file from txmlmap

I used the ((String)globalMap.get("tFileList_1_CURRENT_FILE")) but I got error on tJavaFlexre-error.PNG

How the tFileInputRaw can read the all file ?

Community Manager

Re: Using HTML tag on xml file from txmlmap

You are nearly there. Can you show me the tFileInputRaw component config and you might need to check the tConverType_1 settings. You are getting a null value from there

Seven Stars

Re: Using HTML tag on xml file from txmlmap

raw.PNGconvert.PNG

Community Manager

Re: Using HTML tag on xml file from txmlmap

What code do you have in your tJavaFlex?

 

Also, try putting a tLogRow between the tConvertTYpe and the tJavaFlex. See what is output. You have a a nullpointerexception. It means that an object you are using is null. It's pretty simple to solve, you just need to find out what is null and why

Seven Stars

Re: Using HTML tag on xml file from txmlmap

 

I used your code, and I just change the row name javacode.PNGI have a lot of xml file in my directory but the "Besoin.xml" is not, I tried to copie the the file but still read "Besoin.xml"

Community Manager

Re: Using HTML tag on xml file from txmlmap

Hmmmm, I've just realised what this is. I am not sure how your previous file managed to be read. But you need to use ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) rather than ((String)globalMap.get("tFileList_1_CURRENT_FILE"))

Seven Stars

Re: Using HTML tag on xml file from txmlmap

So now its work Smiley Happy

But ( yea again but but but.....) He show me only 1 file , and not all file in directory :s

 

EDIT: And on my tXMLMap how can I get the data ? because I have only "Content" row on input, and I need to have all xml file structure

Community Manager

Re: Using HTML tag on xml file from txmlmap

You have connected the tFileList using an OnComponentOK. You need to connect it to the next component using the iterate link. Like before.

 

The tXMLMap is a new requirement. I do not know what you mean. You were after the <html> data. You have that now. If you want all of the other data, you will need to get it using the tExtractXMLField in a similar way to the html data.

Seven Stars

Re: Using HTML tag on xml file from txmlmap

Its ok !

I will do other tExtractXMLFiedl for other data, thx for your help and your time !

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.