<?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: tXmlMap : use variable in namespace in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254906#M37779</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for your feedback. Could you please share your work around tjava on forum?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2017 03:42:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-16T03:42:37Z</dc:date>
    <item>
      <title>tXmlMap : use variable in namespace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254903#M37776</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to have dynamical namespace in tXmlMap componant ? The setAsAnamesapce property seems to always used as s litteral string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pat&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:40:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254903#M37776</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: tXmlMap : use variable in namespace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254904#M37777</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;Please feel free to create a new feature jira issue on talend bug tracker.&lt;/P&gt; 
&lt;P&gt;&lt;A title="https://jira.talendforge.org/secure/Dashboard.jspa" href="https://jira.talendforge.org/secure/Dashboard.jspa" target="_self" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/secure/Dashboard.jspa&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 10:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254904#M37777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-14T10:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: tXmlMap : use variable in namespace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254905#M37778</link>
      <description>Thks Sabrina, I will do it. I have applied a work around with a tJava that modify Dom NameSpace before tXmlMapCall</description>
      <pubDate>Thu, 15 Jun 2017 14:24:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254905#M37778</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-15T14:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: tXmlMap : use variable in namespace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254906#M37779</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for your feedback. Could you please share your work around tjava on forum?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 03:42:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254906#M37779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-16T03:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: tXmlMap : use variable in namespace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254907#M37780</link>
      <description>&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 632px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lvb1.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140027iBF29A65D649D57D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lvb1.png" alt="0683p000009Lvb1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lvby.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130139iA8ABFABBD07CDE47/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lvby.png" alt="0683p000009Lvby.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;WS mapping in TXmlMap6 is done without specify nameSpaces, nameSpaces are set by prepareInsertion.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;prepareInsertion : set nodes NameSpace with two NameSpaces stored in variables : context.productDelayServicesSONS and context.productDelayServiceBPMLeadtimefileNS&lt;/P&gt; 
&lt;P&gt;-----------------------&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;org.dom4j.Document document = ((routines.system.Document)input_row.payload).getDocument();&lt;BR /&gt;org.dom4j.Element root = document.getRootElement();&lt;BR /&gt;// treat context node&lt;BR /&gt;org.dom4j.Element elementContext = root.element("context");&lt;BR /&gt;elementContext.add(new org.dom4j.Namespace(null, context.productDelayServicesSONS));&lt;BR /&gt;// treat domainObject node&lt;BR /&gt;elementContext = root.element("domainObject");&lt;BR /&gt;elementContext.add(new org.dom4j.Namespace(null, context.productDelayServiceBPMLeadtimefileNS));&lt;/P&gt; 
&lt;P&gt;output_row.payload = input_row.payload;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;alignResponse :clear WS response namespaces to treat them in new WS call&lt;/P&gt; 
&lt;P&gt;--------------------&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;org.dom4j.Document document2 = ((routines.system.Document)input_row.payload).getDocument();&lt;BR /&gt;org.dom4j.Element root2 = document2.getRootElement();&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;org.dom4j.Namespace ns = root2.getNamespace();&lt;BR /&gt;&lt;BR /&gt;List&amp;lt;org.dom4j.Element&amp;gt; elementLst = root2.elements();&lt;BR /&gt;for (int i=0,l=elementLst.size();i&amp;lt;l;i++)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;elementLst.get(i).setQName(new org.dom4j.QName(elementLst.get(i).getName(), org.dom4j.Namespace.NO_NAMESPACE, &amp;nbsp;&amp;nbsp; &amp;nbsp;elementLst.get(i).getQualifiedName()));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;elementLst.get(i).setQName(org.dom4j.QName.get(elementLst.get(i).getName(), (String)null, (String)null));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ns = elementLst.get(i).getNamespaceForPrefix("tns");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;List&amp;lt;org.dom4j.Element&amp;gt; elementLst2 = elementLst.get(i).elements();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (elementLst2!=null)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for (int j=0,k=elementLst2.size();j&amp;lt;k;j++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;elementLst2.get(j).setQName(new org.dom4j.QName(elementLst2.get(j).getName(), org.dom4j.Namespace.NO_NAMESPACE, elementLst2.get(j).getQualifiedName()));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;elementLst2.get(j).setQName(org.dom4j.QName.get(elementLst2.get(j).getName(), (String)null, (String)null));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;}&lt;BR /&gt;output_row.payload = input_row.payload;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 09:42:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254907#M37780</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-20T09:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: tXmlMap : use variable in namespace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254908#M37781</link>
      <description>&lt;P&gt;You don't need step through the whole DOM tree to define the namespace. You can use some java syntax trick to do is easier.&lt;BR /&gt;&lt;BR /&gt;1. setup the used values in context variable&lt;/P&gt; 
&lt;P&gt;2. in the tXMLMAP: click "Change namespace" to namespace you want to change and use this syntax:&lt;BR /&gt;" + &amp;lt;insert the context variable here&amp;gt; + "&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The thing behind this solution is: Namespace value is a string in the hidden part.You can see similar syntax in your code like below:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;// this is the original use&lt;/P&gt; 
&lt;P&gt;root.addNamespace("tns1", TalendString.replaceSpecialCharForXML("&lt;STRONG&gt;talend/service/TEST/MasterObjects/&lt;/STRONG&gt;"));&lt;/P&gt; 
&lt;P&gt;// this is the trickier use&lt;BR /&gt;root.addNamespace("tns2", TalendString.replaceSpecialCharForXML(&lt;STRONG&gt;""+context.connection_TEST_field1_value+""&lt;/STRONG&gt;));&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;So, with the starting and ending quotation marks we are creating two empty string. With the two '+' symbol we concatonate the context variable value with the two empty string. The result is a string value from context variable. &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can see this solution in the pics below:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ns_trick.jpg" style="width: 540px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4Xg.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142545i0805FDC0661ED2EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4Xg.jpg" alt="0683p000009M4Xg.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Hope I this could help as well!&lt;BR /&gt;&lt;BR /&gt;best regards,&lt;BR /&gt;Viktor&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LvIT"&gt;ns_trick.jpg&lt;/A&gt;</description>
      <pubDate>Fri, 10 May 2019 12:46:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tXmlMap-use-variable-in-namespace/m-p/2254908#M37781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-10T12:46:52Z</dc:date>
    </item>
  </channel>
</rss>

