Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Using an xml that I have entered as metadata (I don't know why, but xsd files are not working 100% with the mapping), I have imported it as tInputFileXML in a job. This file is in attachment. This is the structure in the metadata:
In the file I have 2 transactions, and in each transactions I have 2 changeEvents. 2 of the events are of type QualificationInformationChangeEvent; and 2 are customsqualificationValidityChangeEvent.
The issue: when I try to get the 4 records, I get nulls everywhere. This is the loop XPath query that I use:
"/ns0:replicationMessage/body/transaction/changeEvent"
and the results:
|messageId|sender|recoveryMode|sentOnTime|transactionId|changeType|changeTime|versionId|source|typeOfQualification...
|=--------+------+------------+----------+-------------+----------+----------+---------+------+-------------------+
|null |null |null |null |null |null |null |null |null |null
|null |null |null |null |null |null |null |null |null |null
|null |null |null |null |null |null |null |null |null |null
|null |null |null |null |null |null |null |null |null |null
What went wrong? Any help is welcome.
Hi,
I have finally used the wizard to create the metadata.
Taking my example file, I have created a new input xml
Then I select only the fields from QualificationInformationChangeEvent.
then, in a new job, I dragdropped the metadata as tInputXMLFile, and connected it to a tLogRow.
and it found all the records (2).
Rahll, thanks for your support. I will open now another ticket with my next issue...
Have you configured your XPaths? Can you show us the configuration of your tFileInputXML?
Hi,
thanks. Of course, here it is:
I see your loop shows a namespace, but your XPaths do not. Namespaces can be a bit of a pain here. You have a couple of options, you can add your namespaces to your XPaths. This will be a bit of a pain, but means you are being 100% accurate. Alternatively, goto the "Advanced Settings" and click on the "ignore the namespaces". See if that changes anything
I'm afraid I do not have any jobs where I have done this on the machine I am currently using. I tend to be lazy and just use the "ignore the namespace" option in most cases 🙂
However, this should help you (https://stackoverflow.com/questions/3931817/xpath-expression-from-xml-with-namespace-prefix)
Hi rahll,
ignoring the namespaces didn't work. Any ideas? I'm loosing hope...
Can you give an example of your actual XML file (remove any private data) and the XPaths you have just tried please? I will take a look and see what I can suggest
Hi rahll,
The test I am doing since yesterday is with the file example.xml. The result is exactly the same I get with the real data. If I get to make work example.xml, that's it. The problem is that the file doesn't produce 4 records with data in Talend. It produces 4 records with null values. If I solve the problem with example.xml, I have solved the problem.
Any help is welcome.
Update:
I have created a new job and I have mapped manually some fields. It is working now, but it is going to take me ages to fix all the mapping manually. Here is the mapping: