<?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 Re: [resolved] XPath with context variables not working in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305503#M77147</link>
    <description>Hi sijujohn 
&lt;BR /&gt;you need to construct a valid xpath statement. The xpath statement currently being generated is not valid. 
&lt;BR /&gt;concat('XPath ','is ',)AWFUL! 
&lt;BR /&gt;First, AWFUL! needs to be inside the parentheses and it needs to be inside quotes. Don't confused by the context variable. You are just building a string that happens to be an xpath expression. If you construct a string that is not valid, then you are going to get an error. I believe the xpath expression you want is: 
&lt;BR /&gt;concat('XPath ','is ', 'AWFUL!') 
&lt;BR /&gt;So your expression in Studio should read: 
&lt;BR /&gt;"concat('XPath ','is ', '"+context.emotion,String.class + "')" 
&lt;BR /&gt;Note that I have added an additional set of single quotes around the AWFUL that is being retrieved from the context.</description>
    <pubDate>Wed, 30 May 2012 22:20:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-05-30T22:20:59Z</dc:date>
    <item>
      <title>[resolved] XPath with context variables not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305500#M77144</link>
      <description>&lt;P&gt;I have defined a context variable that should be used in my xpath.&lt;BR /&gt;I have created a route with the following xpath entry for testing purpose.&lt;BR /&gt;"concat('XPath ','is ',)"+context.emotion,String.class&lt;BR /&gt;where emotion is a context variable with value AWFUL!&lt;BR /&gt;This is the error that I get.&lt;BR /&gt;org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: concat('XPath ','is ',)AWFUL!. Reason: javax.xml.xpath.XPathExpressionException&lt;BR /&gt;Any idea on how to resolve this?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 12:16:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305500#M77144</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] XPath with context variables not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305501#M77145</link>
      <description>Can you show a little more of your route? It looks like the concat part is used literally in the xpath.</description>
      <pubDate>Wed, 30 May 2012 09:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305501#M77145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-30T09:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] XPath with context variables not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305502#M77146</link>
      <description>Attached is the image of the route.&lt;BR /&gt;The xpath is being applied at the setBody.</description>
      <pubDate>Wed, 30 May 2012 15:45:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305502#M77146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-30T15:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] XPath with context variables not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305503#M77147</link>
      <description>Hi sijujohn 
&lt;BR /&gt;you need to construct a valid xpath statement. The xpath statement currently being generated is not valid. 
&lt;BR /&gt;concat('XPath ','is ',)AWFUL! 
&lt;BR /&gt;First, AWFUL! needs to be inside the parentheses and it needs to be inside quotes. Don't confused by the context variable. You are just building a string that happens to be an xpath expression. If you construct a string that is not valid, then you are going to get an error. I believe the xpath expression you want is: 
&lt;BR /&gt;concat('XPath ','is ', 'AWFUL!') 
&lt;BR /&gt;So your expression in Studio should read: 
&lt;BR /&gt;"concat('XPath ','is ', '"+context.emotion,String.class + "')" 
&lt;BR /&gt;Note that I have added an additional set of single quotes around the AWFUL that is being retrieved from the context.</description>
      <pubDate>Wed, 30 May 2012 22:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-XPath-with-context-variables-not-working/m-p/2305503#M77147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-30T22:20:59Z</dc:date>
    </item>
  </channel>
</rss>

