<?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 Problem with tFileInputXML with empty tag in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375861#M138175</link>
    <description>Hi, 
&lt;BR /&gt;I have problem with tFileInputXML and empty with data like date or number. I use Java project and TOS Version: V2.1.1 Build id: r4583-20070715-2305. 
&lt;BR /&gt;I have this input file : 
&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-15"?&amp;gt; 
&lt;BR /&gt;&amp;lt;DATA&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_NOM&amp;gt;CSTD_RLIS&amp;lt;/SEQ_NOM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_VALEUR&amp;gt;0&amp;lt;/SEQ_VALEUR&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DATEM&amp;gt;2005-05-01 12:00:00.000&amp;lt;/SEQ_DATEM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MIN&amp;gt;0&amp;lt;/SEQ_MIN&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MAX&amp;gt;999999999&amp;lt;/SEQ_MAX&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_CYCLIQUE&amp;gt;&amp;lt;/SEQ_CYCLIQUE&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DEBUT&amp;gt;&amp;lt;/SEQ_DEBUT&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_INC&amp;gt;1&amp;lt;/SEQ_INC&amp;gt; 
&lt;BR /&gt;&amp;lt;/SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_NOM&amp;gt;CSTD_RSEL&amp;lt;/SEQ_NOM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_VALEUR&amp;gt;0&amp;lt;/SEQ_VALEUR&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DATEM&amp;gt;&amp;lt;/SEQ_DATEM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MIN&amp;gt;0&amp;lt;/SEQ_MIN&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MAX&amp;gt;999999999&amp;lt;/SEQ_MAX&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_CYCLIQUE&amp;gt;0&amp;lt;/SEQ_CYCLIQUE&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DEBUT&amp;gt;1&amp;lt;/SEQ_DEBUT&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_INC&amp;gt;&amp;lt;/SEQ_INC&amp;gt; 
&lt;BR /&gt;&amp;lt;/SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;/DATA&amp;gt; 
&lt;BR /&gt;Tag SEQ_DATEM is timestamp data. 
&lt;BR /&gt;Tags SEQ_CYCLIQUE, SEQ_DEBUT, SEQ_INC are Long or Integer data 
&lt;BR /&gt;When y try to load the file i have this error : 
&lt;BR /&gt;Exception in component tFileInputXML_1 
&lt;BR /&gt;java.lang.NumberFormatException: For input string: "" 
&lt;BR /&gt; at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Integer.java:468) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Integer.java:497) 
&lt;BR /&gt; at routines.system.ParserUtils.parseTo_Integer(ParserUtils.java:62) 
&lt;BR /&gt; at test.test.Test.tFileInputXML_1Process(Test.java:189) 
&lt;BR /&gt; at test.test.Test.main(Test.java:422) 
&lt;BR /&gt;Empty tag are consider like empty string not null value 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; . How can i resolve my problem ? 
&lt;BR /&gt;I join the image of my schema. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards,</description>
    <pubDate>Sat, 16 Nov 2024 14:33:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T14:33:42Z</dc:date>
    <item>
      <title>Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375861#M138175</link>
      <description>Hi, 
&lt;BR /&gt;I have problem with tFileInputXML and empty with data like date or number. I use Java project and TOS Version: V2.1.1 Build id: r4583-20070715-2305. 
&lt;BR /&gt;I have this input file : 
&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-15"?&amp;gt; 
&lt;BR /&gt;&amp;lt;DATA&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_NOM&amp;gt;CSTD_RLIS&amp;lt;/SEQ_NOM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_VALEUR&amp;gt;0&amp;lt;/SEQ_VALEUR&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DATEM&amp;gt;2005-05-01 12:00:00.000&amp;lt;/SEQ_DATEM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MIN&amp;gt;0&amp;lt;/SEQ_MIN&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MAX&amp;gt;999999999&amp;lt;/SEQ_MAX&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_CYCLIQUE&amp;gt;&amp;lt;/SEQ_CYCLIQUE&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DEBUT&amp;gt;&amp;lt;/SEQ_DEBUT&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_INC&amp;gt;1&amp;lt;/SEQ_INC&amp;gt; 
&lt;BR /&gt;&amp;lt;/SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_NOM&amp;gt;CSTD_RSEL&amp;lt;/SEQ_NOM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_VALEUR&amp;gt;0&amp;lt;/SEQ_VALEUR&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DATEM&amp;gt;&amp;lt;/SEQ_DATEM&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MIN&amp;gt;0&amp;lt;/SEQ_MIN&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_MAX&amp;gt;999999999&amp;lt;/SEQ_MAX&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_CYCLIQUE&amp;gt;0&amp;lt;/SEQ_CYCLIQUE&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_DEBUT&amp;gt;1&amp;lt;/SEQ_DEBUT&amp;gt; 
&lt;BR /&gt;&amp;lt;SEQ_INC&amp;gt;&amp;lt;/SEQ_INC&amp;gt; 
&lt;BR /&gt;&amp;lt;/SEQ&amp;gt; 
&lt;BR /&gt;&amp;lt;/DATA&amp;gt; 
&lt;BR /&gt;Tag SEQ_DATEM is timestamp data. 
&lt;BR /&gt;Tags SEQ_CYCLIQUE, SEQ_DEBUT, SEQ_INC are Long or Integer data 
&lt;BR /&gt;When y try to load the file i have this error : 
&lt;BR /&gt;Exception in component tFileInputXML_1 
&lt;BR /&gt;java.lang.NumberFormatException: For input string: "" 
&lt;BR /&gt; at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Integer.java:468) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Integer.java:497) 
&lt;BR /&gt; at routines.system.ParserUtils.parseTo_Integer(ParserUtils.java:62) 
&lt;BR /&gt; at test.test.Test.tFileInputXML_1Process(Test.java:189) 
&lt;BR /&gt; at test.test.Test.main(Test.java:422) 
&lt;BR /&gt;Empty tag are consider like empty string not null value 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; . How can i resolve my problem ? 
&lt;BR /&gt;I join the image of my schema. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards,</description>
      <pubDate>Sat, 16 Nov 2024 14:33:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375861#M138175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375862#M138176</link>
      <description>Hi,&lt;BR /&gt;The problem could be that the contents of the tags are read as string, if you specify that a certain column is an Integer, TOS will create a class Integer parsing the string.&lt;BR /&gt;Of course you can't obtain an Integer class from an empty string.&lt;BR /&gt;I think that you can set all the columns as string and after you can work with Integers and Longs using a tMap.&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 27 Aug 2007 13:58:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375862#M138176</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-08-27T13:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375863#M138177</link>
      <description>Hello, 
&lt;BR /&gt;we have just the same problem that you with tFileInputXML component. 
&lt;BR /&gt;We have been looking for a better solution and we have discovered that problem is on code generated. 
&lt;BR /&gt;When tFileInputXML component is looking for the data of a XML node is using XPath (org.dom4j.xpath.DefaultXPath class of dom4j-1.6.1.jar exactly), and when node is not present or value is empty, the "valueOf" method is returning "" (empty String), instead of null value. 
&lt;BR /&gt;This is the default implementation of DOM4J API, so we think that this API is working fine, according to standar. 
&lt;BR /&gt;(If this isn't correct then maybe this API must fix this bug.) 
&lt;BR /&gt;With Talend, in the java source code generated of tFileInputXML component, there is a line to prevent it (null value) but the comparation is only against null value, not empty value. 
&lt;BR /&gt;The line is like: if (str_tFileInputXML_1 != null) 
&lt;BR /&gt;Then the solution is about to do both comparations, prevent it about null value and about empty value, like this: 
&lt;BR /&gt;if (str_tFileInputXML_1 != null &amp;amp;&amp;amp; str_tFileInputXML_1.length() &amp;gt; 0) 
&lt;BR /&gt; 
&lt;BR /&gt;Therefore, we think that a possible solution is modify the tFileInputXML component: 
&lt;BR /&gt;In tFileInputXML_begin.javajet, line 111, where it's write "if (str_&amp;lt;%=cid %&amp;gt; != null ) { " 
&lt;BR /&gt;replace it with "if (str_&amp;lt;%=cid %&amp;gt; != null &amp;amp;&amp;amp; str_&amp;lt;%=cid %&amp;gt;.length() &amp;gt; 0) { " 
&lt;BR /&gt;With this change, the mapping from XML data to Talend/Java types is possible and very easy. 
&lt;BR /&gt;We have made this change and all is working fine, so we think that it's a solution for this presumptive "bug". 
&lt;BR /&gt; 
&lt;BR /&gt;NOTE: I suppose that in perl lenguage is possible to do the same, but we can't try it. 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 20 Dec 2007 11:59:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375863#M138177</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-12-20T11:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375864#M138178</link>
      <description>Hello again, 
&lt;BR /&gt;we are using the latest stable version:
&lt;BR /&gt;Talend Version: 2.2.2
&lt;BR /&gt;Build id: r7074-20071116-2048
&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 20 Dec 2007 14:56:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375864#M138178</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-12-20T14:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375865#M138179</link>
      <description>Hi dmerino
&lt;BR /&gt;We will consider your suggestion and learn your code.
&lt;BR /&gt;Thanks for your support!
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Fri, 21 Dec 2007 06:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375865#M138179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-21T06:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375866#M138180</link>
      <description>I think that the best solution is to open a bugtracker for this bug. We have the same problem and it is a big issue in TALEND right now. &lt;BR /&gt;There is another case related to this one : Problem when XML tag element is not present in the XML file. &lt;BR /&gt;Indeed in XML if a field is not mandatory it can be present or not in the file. &lt;BR /&gt;In this case TALEND fill the field with empty string. It is not good the field must be initialised to NULL or better excluded from the schema.</description>
      <pubDate>Thu, 17 Jan 2008 12:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375866#M138180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-17T12:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375867#M138181</link>
      <description>Hi, 
&lt;BR /&gt;I tried the solution of dmerino but it doesn't work. 
&lt;BR /&gt;Indeed, in the generated java code, no value is assigned to the field if it's null or empty. 
&lt;BR /&gt;So the value is not changed and it?s the previous value (of the previous element) 
&lt;BR /&gt;By exemple, with the file : 
&lt;BR /&gt;&amp;lt;client&amp;gt; 
&lt;BR /&gt; &amp;lt;name&amp;gt;name1&amp;lt;/name&amp;gt; 
&lt;BR /&gt; &amp;lt;firstname&amp;gt;firstname1&amp;lt;/firstame&amp;gt; 
&lt;BR /&gt;&amp;lt;/client&amp;gt; 
&lt;BR /&gt;&amp;lt;client&amp;gt; 
&lt;BR /&gt; &amp;lt;name&amp;gt;name2&amp;lt;/name&amp;gt; 
&lt;BR /&gt;&amp;lt;/client&amp;gt; 
&lt;BR /&gt;&amp;lt;client&amp;gt; 
&lt;BR /&gt; &amp;lt;name&amp;gt;&amp;lt;/name&amp;gt; 
&lt;BR /&gt; &amp;lt;firstname&amp;gt;firstname3&amp;lt;/firstame&amp;gt; 
&lt;BR /&gt;&amp;lt;/client&amp;gt; 
&lt;BR /&gt;The log row result with dmerino solution is : 
&lt;BR /&gt;name1|firstname1 
&lt;BR /&gt;name2|firstname1 
&lt;BR /&gt;name2|firstname3 
&lt;BR /&gt;The lgood og row result is : 
&lt;BR /&gt;name1|firstname1 
&lt;BR /&gt;name2| 
&lt;BR /&gt;|firstname3 
&lt;BR /&gt;For information, we use the java version v2.2.2 r7074. 
&lt;BR /&gt;I did another modification in tFileInputXML to fix the problem. 
&lt;BR /&gt;I opened a bugtracker (where you can see the modified code) : 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCkiXCAS" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/tReplace-Java/td-p/75529&lt;/A&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375867#M138181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T14:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tFileInputXML with empty tag</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375868#M138182</link>
      <description>Hello, &lt;BR /&gt;I have added a note in this 2834.&lt;BR /&gt;Regards,</description>
      <pubDate>Fri, 18 Jan 2008 16:21:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Problem-with-tFileInputXML-with-empty-tag/m-p/2375868#M138182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T16:21:24Z</dc:date>
    </item>
  </channel>
</rss>

