<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [XML] Reading nested NodeSets / NodeLists in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350587#M117415</link>
    <description>Greetings! 
&lt;BR /&gt;I have run into a bit of a dead-end with reading XML. I can use tExtractXMLField to parse an XML file via XPath, but I cannot think of how to parse said XML when there are multiple nested node lists. 
&lt;BR /&gt;Easier illustrated via an example: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;database&amp;gt;&lt;BR /&gt;    &amp;lt;people&amp;gt;&lt;BR /&gt;        &amp;lt;person&amp;gt;&lt;BR /&gt;            &amp;lt;name&amp;gt;John&amp;lt;/name&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Billy&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Bobby&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Samantha&amp;lt;/child&amp;gt;&lt;BR /&gt;        &amp;lt;/person&amp;gt;&lt;BR /&gt;        &amp;lt;person&amp;gt;&lt;BR /&gt;            &amp;lt;name&amp;gt;Maria&amp;lt;/name&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Kyle&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Michael&amp;lt;/child&amp;gt;&lt;BR /&gt;        &amp;lt;person&amp;gt;&lt;BR /&gt;            &amp;lt;name&amp;gt;Steven&amp;lt;/name&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Stephanie&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Joanne&amp;lt;/child&amp;gt;&lt;BR /&gt;        &amp;lt;/person&amp;gt;&lt;BR /&gt;    &amp;lt;/people&amp;gt;&lt;BR /&gt;&amp;lt;/database&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;In the above case, the NodeSet of &amp;lt;person&amp;gt; has an "XPath Loop Query" (within Talend) of "/database/people/person". Within that NodeSet, we have XPath "./name" for &amp;lt;name&amp;gt; and "./child" for another NodeSet of &amp;lt;child&amp;gt;. Assuming there was just one child, one could simply use tExtractXMLField set up ala: 
&lt;BR /&gt;XPath Loop Query: /database/people/person 
&lt;BR /&gt;Column | XPath 
&lt;BR /&gt;Name | ./name 
&lt;BR /&gt;Child | ./child 
&lt;BR /&gt;./child is a NodeSet however, and I imagine simply calling ./child will return the first (or the last?) one only. I need to figure out how to, given the above mock XML, end up with an array of pairs (personName,child) for every child. I am currently exploring the 'Get Nodes' option, but I cannot seem to find any concrete docs that would allow me to solve the above situation. 
&lt;BR /&gt;Any help would be greatly appreciated!</description>
    <pubDate>Fri, 09 Mar 2012 19:17:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-03-09T19:17:11Z</dc:date>
    <item>
      <title>[XML] Reading nested NodeSets / NodeLists</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350587#M117415</link>
      <description>Greetings! 
&lt;BR /&gt;I have run into a bit of a dead-end with reading XML. I can use tExtractXMLField to parse an XML file via XPath, but I cannot think of how to parse said XML when there are multiple nested node lists. 
&lt;BR /&gt;Easier illustrated via an example: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;database&amp;gt;&lt;BR /&gt;    &amp;lt;people&amp;gt;&lt;BR /&gt;        &amp;lt;person&amp;gt;&lt;BR /&gt;            &amp;lt;name&amp;gt;John&amp;lt;/name&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Billy&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Bobby&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Samantha&amp;lt;/child&amp;gt;&lt;BR /&gt;        &amp;lt;/person&amp;gt;&lt;BR /&gt;        &amp;lt;person&amp;gt;&lt;BR /&gt;            &amp;lt;name&amp;gt;Maria&amp;lt;/name&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Kyle&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Michael&amp;lt;/child&amp;gt;&lt;BR /&gt;        &amp;lt;person&amp;gt;&lt;BR /&gt;            &amp;lt;name&amp;gt;Steven&amp;lt;/name&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Stephanie&amp;lt;/child&amp;gt;&lt;BR /&gt;            &amp;lt;child&amp;gt;Joanne&amp;lt;/child&amp;gt;&lt;BR /&gt;        &amp;lt;/person&amp;gt;&lt;BR /&gt;    &amp;lt;/people&amp;gt;&lt;BR /&gt;&amp;lt;/database&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;In the above case, the NodeSet of &amp;lt;person&amp;gt; has an "XPath Loop Query" (within Talend) of "/database/people/person". Within that NodeSet, we have XPath "./name" for &amp;lt;name&amp;gt; and "./child" for another NodeSet of &amp;lt;child&amp;gt;. Assuming there was just one child, one could simply use tExtractXMLField set up ala: 
&lt;BR /&gt;XPath Loop Query: /database/people/person 
&lt;BR /&gt;Column | XPath 
&lt;BR /&gt;Name | ./name 
&lt;BR /&gt;Child | ./child 
&lt;BR /&gt;./child is a NodeSet however, and I imagine simply calling ./child will return the first (or the last?) one only. I need to figure out how to, given the above mock XML, end up with an array of pairs (personName,child) for every child. I am currently exploring the 'Get Nodes' option, but I cannot seem to find any concrete docs that would allow me to solve the above situation. 
&lt;BR /&gt;Any help would be greatly appreciated!</description>
      <pubDate>Fri, 09 Mar 2012 19:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350587#M117415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-09T19:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: [XML] Reading nested NodeSets / NodeLists</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350588#M117416</link>
      <description>Hi,
&lt;BR /&gt;Try starting with child rather than person. A child's always going to have a parent person and probably a name, so that's the most reliable driver. See this blog post that recommends analyzing the XML from the bottom up (rather than top down).
&lt;BR /&gt;
&lt;A href="http://bekwam.blogspot.com/2011/07/xpath-loops-in-talend-open-studio.html" rel="nofollow noopener noreferrer"&gt;http://bekwam.blogspot.com/2011/07/xpath-loops-in-talend-open-studio.html&lt;/A&gt;</description>
      <pubDate>Fri, 09 Mar 2012 23:41:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350588#M117416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-09T23:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: [XML] Reading nested NodeSets / NodeLists</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350589#M117417</link>
      <description>I am really impressed with your writing skills as well as with the layout on your weblog. 
&lt;A href="http://www.bodychecksupplement.co.uk/" target="_blank" rel="nofollow noopener noreferrer"&gt;bodybuilding supplements&lt;/A&gt; Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, it?s rare to see a nice blog like this one these days..</description>
      <pubDate>Sun, 11 Mar 2012 07:34:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350589#M117417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-11T07:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: [XML] Reading nested NodeSets / NodeLists</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350590#M117418</link>
      <description>For detailed explanation of reading and processing XML file with multiple nested loops visit the blog post 
&lt;BR /&gt;
&lt;A href="http://vikramtakkar.com/2013/02/read-xml-having-multiple-nested-loops.html" rel="nofollow noopener noreferrer"&gt;http://vikramtakkar.com/2013/02/read-xml-having-multiple-nested-loops.html&lt;/A&gt;</description>
      <pubDate>Wed, 27 Feb 2013 07:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Reading-nested-NodeSets-NodeLists/m-p/2350590#M117418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-27T07:02:36Z</dc:date>
    </item>
  </channel>
</rss>

