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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFileInputXML parsing issue

I am using tFileInputXML  to parse XML files. 

 

My XML file looks similar to as below:

 

<organisation>

    <orgname>

            ABCD

    </orgname>

    <name>

            O sullivan

     </name>

     <address>

             <houseno>  123   </houseno>

             <street>par street </street>

             <state>Alabama </state>

    </address>

 

  

    <examdetails

          <subject> maths</subject>

                 <marks>70</marks>

          <subject>science</subject>

                  <marks> 20</marks>

   </examdetails>

 

 

 

Here, I define the Local XPath query as follows:

 

"/*[local-name()='organisation']/*[local-name()='address']/*[local-name()='street']"

 

 

 

the in Mapping:

 

column 'street', I use XPath Query as 'text()'

column 'exam' should provide me a value of true if the node 'subject is present in the XML file. Here there are two nodes with subject. How should I define the XPath Query for this. Some XML files do not have the node subject, in that case it should return false. All the XML files contains the node 'examdetails'.

 

whe I use the XPath query 

"../../../*[local-name()='examdetails']/*[local-name()='subject']"

for column exam, I am getting null. 

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello,

Could you please try to set up xml metadata for your input file to see if it works?

Here is document about:TalendHelpCenter:Centralizing XML file metadata

Best regards

Sabrina

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Hello,

Could you please try to set up xml metadata for your input file to see if it works?

Here is document about:TalendHelpCenter:Centralizing XML file metadata

Best regards

Sabrina