<?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 Distinguishing null values, empty values and elements not present in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366909#M130341</link>
    <description>Hello,
&lt;BR /&gt;we are building an webservice that will be updating data. For simplicity, lets assume that there are 3 elements that can be updated (A as xs:string, B as xs:date and C as xs:integer).
&lt;BR /&gt;We need to be able to distinguish whether element was ommited in the request (means - do not update), was present and was set to null value (empty string or xsi:nil, means - update and set to null), was present and was set to not null value (means - update to given value).
&lt;BR /&gt;What is the best approach to accomplish this in Talend ESB? It seems like ommited elements and elements with empty/null value are both treated as "null" in tXMLMap.
&lt;BR /&gt;Any advice appreciated.
&lt;BR /&gt;Few examples:
&lt;BR /&gt;&amp;lt;A&amp;gt;val1&amp;lt;/A&amp;gt;&amp;lt;B&amp;gt;2015-01-01Z&amp;lt;/B&amp;gt;&amp;lt;C&amp;gt;1&amp;lt;/C&amp;gt; &amp;lt;!-- update all --&amp;gt;
&lt;BR /&gt;&amp;lt;A&amp;gt;val1&amp;lt;/A&amp;gt;&amp;lt;C&amp;gt;1&amp;lt;/C&amp;gt; &amp;lt;!-- update A and C, leave B unchanged --&amp;gt;
&lt;BR /&gt;&amp;lt;A&amp;gt;val1&amp;lt;/A&amp;gt;&amp;lt;C xsi:nil="true" /&amp;gt; &amp;lt;!-- update A, leave B unchanged, set C to null --&amp;gt;</description>
    <pubDate>Sat, 16 Nov 2024 11:09:46 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2024-11-16T11:09:46Z</dc:date>
    <item>
      <title>Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366909#M130341</link>
      <description>Hello,
&lt;BR /&gt;we are building an webservice that will be updating data. For simplicity, lets assume that there are 3 elements that can be updated (A as xs:string, B as xs:date and C as xs:integer).
&lt;BR /&gt;We need to be able to distinguish whether element was ommited in the request (means - do not update), was present and was set to null value (empty string or xsi:nil, means - update and set to null), was present and was set to not null value (means - update to given value).
&lt;BR /&gt;What is the best approach to accomplish this in Talend ESB? It seems like ommited elements and elements with empty/null value are both treated as "null" in tXMLMap.
&lt;BR /&gt;Any advice appreciated.
&lt;BR /&gt;Few examples:
&lt;BR /&gt;&amp;lt;A&amp;gt;val1&amp;lt;/A&amp;gt;&amp;lt;B&amp;gt;2015-01-01Z&amp;lt;/B&amp;gt;&amp;lt;C&amp;gt;1&amp;lt;/C&amp;gt; &amp;lt;!-- update all --&amp;gt;
&lt;BR /&gt;&amp;lt;A&amp;gt;val1&amp;lt;/A&amp;gt;&amp;lt;C&amp;gt;1&amp;lt;/C&amp;gt; &amp;lt;!-- update A and C, leave B unchanged --&amp;gt;
&lt;BR /&gt;&amp;lt;A&amp;gt;val1&amp;lt;/A&amp;gt;&amp;lt;C xsi:nil="true" /&amp;gt; &amp;lt;!-- update A, leave B unchanged, set C to null --&amp;gt;</description>
      <pubDate>Sat, 16 Nov 2024 11:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366909#M130341</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T11:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366910#M130342</link>
      <description>Use an XPath to test to see if the element actually exists combined with the null check. So if it is null and doesn't exist it means one thing, if it is null and does exist it means the other thing.</description>
      <pubDate>Wed, 01 Jul 2015 11:24:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366910#M130342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-01T11:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366911#M130343</link>
      <description>hello, 
&lt;BR /&gt;could you be please a little more specific? 
&lt;BR /&gt;I tried to create an XPATH expression in TXMLMap&amp;nbsp;to test if this node is present however it failed to compile ( 
&lt;FONT color="#7f0055"&gt;&lt;FONT size="2"&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp; boolean&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;FONT size="2"&gt;()) &lt;/FONT&gt;, seems like these expressions do not support xpath. 
&lt;BR /&gt;How do I create an xpath expression in tXMLMap? 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;Thanks,&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;Adam&lt;/FONT&gt;</description>
      <pubDate>Wed, 08 Jul 2015 11:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366911#M130343</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-07-08T11:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366912#M130344</link>
      <description>Use a tExtractXMLField component to test the XPath. Use that component to return the full XML and the result of the XPath. Then send that to a tMap and use conditional logic based on the result of the XPath to decide where to send the XML for further processing.</description>
      <pubDate>Wed, 08 Jul 2015 11:44:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366912#M130344</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T11:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366913#M130345</link>
      <description>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;Thanks, this got me going, however still not there... 
&lt;BR /&gt;I configured the tExtractXMLField as (I think) you suggested. The payload gets extracted properly. However population of fi_string fails - in the error log I can see either - seems like the result must be a node: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;I&gt;Exception occurred evaluting XPath: The result of the XPath expression is not a Node. It was: false of type: java.lang.Boolean&lt;/I&gt; 
&lt;BR /&gt;or 
&lt;BR /&gt; 
&lt;I&gt;Exception occurred evaluting XPath: The result of the XPath expression is not a Node. It was: true of type: java.lang.Boolean&lt;/I&gt; 
&lt;BR /&gt;depending of whether the element was or was not there. 
&lt;BR /&gt;Screenshot: 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/200374/Capture1.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAfX.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150854iD5F5509D45EB07B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAfX.png" alt="0683p000009MAfX.png" /&gt;&lt;/span&gt;&lt;/A&gt;</description>
      <pubDate>Wed, 08 Jul 2015 13:05:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366913#M130345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T13:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366914#M130346</link>
      <description>It's a bit difficult to debug this without seeing it, but it sounds like you do not have the correct type set for your column. I'm guessing you have it set as a String but the data is returning a Boolean. The response type must match the column type. I'm guessing that changing the column type to a Boolean will fix this.</description>
      <pubDate>Wed, 08 Jul 2015 13:10:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366914#M130346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T13:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366915#M130347</link>
      <description>Are you able to see the attached screenshot in my previous post? On the bottom side there is a partial screenshot from the schema. The column I am populating it to is defined as "Boolean" and "Get Nodes" property on this column is unchecked.</description>
      <pubDate>Wed, 08 Jul 2015 14:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366915#M130347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T14:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366916#M130348</link>
      <description>Sorry I missed that. What you are doing looks OK. It must be something to do with the XPath. XPaths are notoriously tricky with Talend and I tend to try them out on test sites online before plugging them into Talend......and still have trouble getting some of them to work. I'm afraid I can't give you the answer on this one. I think you will need to play around with it until you get it right.</description>
      <pubDate>Wed, 08 Jul 2015 14:17:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366916#M130348</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T14:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366917#M130349</link>
      <description>I believe the problem is in how the code is generated. 
&lt;BR /&gt;In my case: 
&lt;BR /&gt;row2.payload = ParserUtils 
&lt;BR /&gt;.parseTo_Document(str_tExtractXMLField_1); 
&lt;BR /&gt;org.dom4j.XPath xTmp1_tExtractXMLField_1 = temp_tExtractXMLField_1 
&lt;BR /&gt;.createXPath(nsTool_tExtractXMLField_1 
&lt;BR /&gt;.addDefaultNSPrefix( 
&lt;BR /&gt;"boolean(cbs:validateRequest/cbs:msgDataReq/tns:t_ulica)", 
&lt;BR /&gt;loopQuery_tExtractXMLField_1)); 
&lt;BR /&gt;xTmp1_tExtractXMLField_1 
&lt;BR /&gt;.setNamespaceURIs(xmlNameSpaceMap_tExtractXMLField_1); 
&lt;BR /&gt;xTmp1_tExtractXMLField_1 
&lt;BR /&gt;.setNamespaceContext(namespaceContext_tExtractXMLField_1); 
&lt;BR /&gt;Object obj1_tExtractXMLField_1 = xTmp1_tExtractXMLField_1 
&lt;BR /&gt;.evaluate(temp_tExtractXMLField_1); 
&lt;BR /&gt;if (obj1_tExtractXMLField_1 instanceof String 
&lt;BR /&gt;|| obj1_tExtractXMLField_1 instanceof Number) { 
&lt;BR /&gt;resultIsNode_tExtractXMLField_1 = false; 
&lt;BR /&gt;str_tExtractXMLField_1 = String 
&lt;BR /&gt;.valueOf(obj1_tExtractXMLField_1); 
&lt;BR /&gt;} else { 
&lt;BR /&gt;resultIsNode_tExtractXMLField_1 = true; 
&lt;BR /&gt;node_tExtractXMLField_1 = xTmp1_tExtractXMLField_1 
&lt;BR /&gt;.selectSingleNode(temp_tExtractXMLField_1); 
&lt;BR /&gt;str_tExtractXMLField_1 = xTmp1_tExtractXMLField_1 
&lt;BR /&gt;.valueOf(temp_tExtractXMLField_1); 
&lt;BR /&gt;} 
&lt;BR /&gt;And the problem is that obj1_tExtractXMLField_1 is created as "Boolean" (which is correct), however the subsequent test checks it only agains String or Number, anything else is considered a Node. 
&lt;BR /&gt;I believe this might actually be a bug that the generated code does not check for Boolean.</description>
      <pubDate>Wed, 08 Jul 2015 14:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366917#M130349</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T14:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366918#M130350</link>
      <description>Yep, after changing the Xpath expression from boolean(..) to count(..), it started working.</description>
      <pubDate>Wed, 08 Jul 2015 14:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366918#M130350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T14:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing null values, empty values and elements not present</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366919#M130351</link>
      <description>Well spotted. There is a Jira site for raising issues like this. I think your description there would be good enough to point the developers in the right direction. The link to the Jira site is&amp;nbsp;https://jira.talendforge.org/secure/Dashboard.jspa</description>
      <pubDate>Wed, 08 Jul 2015 14:45:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Distinguishing-null-values-empty-values-and-elements-not-present/m-p/2366919#M130351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T14:45:59Z</dc:date>
    </item>
  </channel>
</rss>

