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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tExtractXMLField help required

Hi,
Is there any online example which explains how to configure a tExtractXMLField component?
I am using Talend v6.1 and I have a peculiar problem with this component. I am having a database table (MS SQL) which has a column/field that contains some XML data.
The data is in the following format:
<Attributes>
<Attribute>
<DisplayOrder>1</DisplayOrder>
<Name></Name>
<Alias>SSI</Alias>
<Length>20</Length>
<DefaultValue>2</DefaultValue>
</Attribute>
<Attribute>
<DisplayOrder>2</DisplayOrder>
<Name>PII</Name>
<Alias>PII</Alias>
<Length>20</Length>
<DefaultValue>1979</DefaultValue>
</Attribute>
</Attributes>

In the ETL job I am reading this data using a tMSSqlInput component and linking it to a tExtractXMLField component via Main.
Then I am trying to read the XML fields individually and display the contents of each field using a tLogRow component. My ultimate aim is to insert this read data into another MS SQL database table.
The job design is as follows
0683p000009MG1u.png
As you can see one row is read from the database but 0 rows are passed from the XML component.
The schema of the tMSSqlInput component has the name of the single field that is selected in the query as shown below
0683p000009MG0Z.png
This same field is mapped against the "XML field" field of the tExtractXMLField component.
The output schema of tExtractXMLField is defined as follows:
0683p000009MFwC.png
And the "Loop XPath query" is given as "\Attributes\Attribute" and each of the field that needs to be extracted is given as "<FieldName>" against their respective fields defined in the output schema of the tExtractXMLField.

0683p000009MG1z.png

Can anyone tell me what is the issue with this job?

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

what we can see - path == "\Attributes\Attrib" but not "\Attributes\Attribute"  0683p000009MACJ.png
but most important it must be - "//Attributes/Attribute"

little more about Path -  http://www.jasonstrate.com/2010/11/xquery-for-the-non-expert-exist/ or  http://goessner.net/articles/JsonPath/
last about JSONPath but compare with Path

View solution in original post

2 Replies
vapukov
Master II
Master II

what we can see - path == "\Attributes\Attrib" but not "\Attributes\Attribute"  0683p000009MACJ.png
but most important it must be - "//Attributes/Attribute"

little more about Path -  http://www.jasonstrate.com/2010/11/xquery-for-the-non-expert-exist/ or  http://goessner.net/articles/JsonPath/
last about JSONPath but compare with Path
Anonymous
Not applicable
Author

Thank you vapukov, that helped me a lot!