<?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 XPath - how to use position() in XMLInput in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/XPath-how-to-use-position-in-XMLInput/m-p/2316128#M86705</link>
    <description>Hello folks, 
&lt;BR /&gt;i have come across this file that has no identifier for the &amp;lt;b&amp;gt;Item&amp;lt;/b&amp;gt;: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;Items&amp;gt;&lt;BR /&gt;  &amp;lt;Item&amp;gt;&lt;BR /&gt;    &amp;lt;Detail1&amp;gt;A&amp;lt;/Detail1&amp;gt;&lt;BR /&gt;    &amp;lt;Detail3&amp;gt;B&amp;lt;/Detail2&amp;gt;&lt;BR /&gt;    &amp;lt;Detail4&amp;gt;B&amp;lt;/Detail4&amp;gt;&lt;BR /&gt;    ...&lt;BR /&gt;  &amp;lt;/Item&amp;gt;&lt;BR /&gt;  &amp;lt;Item&amp;gt;&lt;BR /&gt;    &amp;lt;Detail2&amp;gt;B&amp;lt;/Detail2&amp;gt;&lt;BR /&gt;    &amp;lt;Detail4&amp;gt;B&amp;lt;/Detail4&amp;gt;&lt;BR /&gt;    ...&lt;BR /&gt;  &amp;lt;/Item&amp;gt;&lt;BR /&gt;  ...&lt;BR /&gt;&amp;lt;/Items&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;i would like to get the output of this file normalised to: 
&lt;BR /&gt; 
&lt;PRE&gt;Item   |Detail1   |Detail2     |Detail3     |Detail4&lt;BR /&gt;1      |A         |            |B           |B&lt;/PRE&gt; 
&lt;BR /&gt;where the value of item would be returned by the XPath expression 
&lt;B&gt;position()&lt;/B&gt; 
&lt;BR /&gt;But i am failing to understand how the expression should be entered in the tFileInputXML 
&lt;BR /&gt;this is a similar question to: 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCkVPCA0" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/XML-record-count/td-p/74328&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;and i would very much appreciate assistance with this. 
&lt;BR /&gt;regards</description>
    <pubDate>Thu, 28 Mar 2013 16:37:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-03-28T16:37:24Z</dc:date>
    <item>
      <title>XPath - how to use position() in XMLInput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XPath-how-to-use-position-in-XMLInput/m-p/2316128#M86705</link>
      <description>Hello folks, 
&lt;BR /&gt;i have come across this file that has no identifier for the &amp;lt;b&amp;gt;Item&amp;lt;/b&amp;gt;: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;Items&amp;gt;&lt;BR /&gt;  &amp;lt;Item&amp;gt;&lt;BR /&gt;    &amp;lt;Detail1&amp;gt;A&amp;lt;/Detail1&amp;gt;&lt;BR /&gt;    &amp;lt;Detail3&amp;gt;B&amp;lt;/Detail2&amp;gt;&lt;BR /&gt;    &amp;lt;Detail4&amp;gt;B&amp;lt;/Detail4&amp;gt;&lt;BR /&gt;    ...&lt;BR /&gt;  &amp;lt;/Item&amp;gt;&lt;BR /&gt;  &amp;lt;Item&amp;gt;&lt;BR /&gt;    &amp;lt;Detail2&amp;gt;B&amp;lt;/Detail2&amp;gt;&lt;BR /&gt;    &amp;lt;Detail4&amp;gt;B&amp;lt;/Detail4&amp;gt;&lt;BR /&gt;    ...&lt;BR /&gt;  &amp;lt;/Item&amp;gt;&lt;BR /&gt;  ...&lt;BR /&gt;&amp;lt;/Items&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;i would like to get the output of this file normalised to: 
&lt;BR /&gt; 
&lt;PRE&gt;Item   |Detail1   |Detail2     |Detail3     |Detail4&lt;BR /&gt;1      |A         |            |B           |B&lt;/PRE&gt; 
&lt;BR /&gt;where the value of item would be returned by the XPath expression 
&lt;B&gt;position()&lt;/B&gt; 
&lt;BR /&gt;But i am failing to understand how the expression should be entered in the tFileInputXML 
&lt;BR /&gt;this is a similar question to: 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCkVPCA0" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/XML-record-count/td-p/74328&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;and i would very much appreciate assistance with this. 
&lt;BR /&gt;regards</description>
      <pubDate>Thu, 28 Mar 2013 16:37:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XPath-how-to-use-position-in-XMLInput/m-p/2316128#M86705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-28T16:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: XPath - how to use position() in XMLInput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XPath-how-to-use-position-in-XMLInput/m-p/2316129#M86706</link>
      <description>This shows an XPath that returns the sequence of the parent node.
&lt;BR /&gt;
&lt;A href="http://blogs.msdn.com/b/asanto/archive/2004/09/08/226663.aspx" rel="nofollow noopener noreferrer"&gt;http://blogs.msdn.com/b/asanto/archive/2004/09/08/226663.aspx&lt;/A&gt;
&lt;BR /&gt;count(parent::*/preceding-sibling::*) + 1
&lt;BR /&gt;
&lt;BR /&gt;However when run in 'Refresh Preview' or in a job the column is empty.
&lt;BR /&gt;When the job is configured with 'Get Nodes' enabled on the tFileInputXML then the results show that the sequence is being calculated.
&lt;BR /&gt;e.g. from a different dataset:
&lt;BR /&gt;.-------------------+----------------------------------+--------.
&lt;BR /&gt;| tLogRow_1 |
&lt;BR /&gt;|=------------------+----------------------------------+-------=|
&lt;BR /&gt;|key |value |entityid|
&lt;BR /&gt;|=------------------+----------------------------------+-------=|
&lt;BR /&gt;|key="jurisdiction" |value="GB" |1.0 |
&lt;BR /&gt;|key="domicile" |value="UK" |1.0 |
&lt;BR /&gt;How can the column I call 'entityid', computed from the earlier 'count...' XPath be accessed? 
&lt;BR /&gt;The first two columns of output show the full node value of their attribute, so could potentially be parsed.</description>
      <pubDate>Thu, 28 Mar 2013 18:25:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XPath-how-to-use-position-in-XMLInput/m-p/2316129#M86706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-28T18:25:56Z</dc:date>
    </item>
  </channel>
</rss>

