Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
spr654
Creator
Creator

tInputFileXML returns null values in Open Studio 7.1

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:

 

0683p000009M3D6.png

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"

0683p000009M04S.png

 

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.

 

 

Labels (3)
1 Solution

Accepted Solutions
spr654
Creator
Creator
Author

Hi,

 

I have finally used the wizard to create the metadata.

 

Taking my example file, I have created a new input xml

 

0683p000009M3IB.png

Then I select only the fields from QualificationInformationChangeEvent.

0683p000009M2B6.png

 

then, in a new job, I dragdropped the metadata as tInputXMLFile, and connected it to a tLogRow.

0683p000009M3IL.png

 

and it found all the records (2). 

Rahll, thanks for your support. I will open now another ticket with my next issue...

 

 

 

View solution in original post

11 Replies
Anonymous
Not applicable

Have you configured your XPaths? Can you show us the configuration of your tFileInputXML?

spr654
Creator
Creator
Author

Hi,

 

thanks. Of course, here it is:

0683p000009M38R.png

 

 

Anonymous
Not applicable

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

spr654
Creator
Creator
Author

Hi rahll, Thank you very much for your help. How can I add a namespace in a xpath? Could you show a picture of what you mean? Where should I add it? Thanks for your help and support.
Anonymous
Not applicable

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)

spr654
Creator
Creator
Author

Hi rahll,

 

ignoring the namespaces didn't work. Any ideas? I'm loosing hope...

Anonymous
Not applicable

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

spr654
Creator
Creator
Author

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.

spr654
Creator
Creator
Author

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:

 

0683p000009M3Fq.png