<?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: XML Attribute Namespace, Lookup Tables in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341383#M109342</link>
    <description>Sorry if I have confused you.&lt;BR /&gt;Let me make it clear.&lt;BR /&gt;Input: A flat file which I'm using RegEx to extract data (details not required)&lt;BR /&gt;Output: XML file.&lt;BR /&gt;The output is the XML file, I'm not trying to "retrieve the value from 'SomeElement' dynamically."&lt;BR /&gt;(1) Given Input from any file, I want to create a map as shown above.&lt;BR /&gt;(2) From the map I want to populate the href field of the xml.</description>
    <pubDate>Wed, 14 Dec 2011 10:53:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-12-14T10:53:03Z</dc:date>
    <item>
      <title>XML Attribute Namespace, Lookup Tables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341379#M109338</link>
      <description>Hi, &lt;BR /&gt;(1) I'm trying to generate:&lt;BR /&gt;&amp;lt;Host xlink:type="simple" xlink:href="#SomeElement1"/&amp;gt;&lt;BR /&gt;I'm not able to set namespaces for attributes such as xlink:type in the above example.&lt;BR /&gt;(2) Next I need to populate the values for xlink:href to some other xml elements within the document.&lt;BR /&gt;What would be possible ways to achieve this?&lt;BR /&gt;       (a) One way would be to have a Map/LookupTable which I can query to retrieve the right element I need to link to, with which I can populate xlink:href.&lt;BR /&gt;            How do I do this?</description>
      <pubDate>Sat, 16 Nov 2024 12:30:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341379#M109338</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: XML Attribute Namespace, Lookup Tables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341380#M109339</link>
      <description>Hi
&lt;BR /&gt;
&lt;PRE&gt;&amp;lt;Host&lt;BR /&gt;  xmlns:my="http://example.com/"&lt;BR /&gt;  xmlns:xlink="http://www.w3.org/1999/xlink"&lt;BR /&gt;  xlink:type="simple"&lt;BR /&gt;  xlink:href="#SomeElement1"&lt;BR /&gt;  /&amp;gt;&lt;/PRE&gt;
&lt;BR /&gt;Could you show me more details, input files and results you want?
&lt;BR /&gt;I can't catch your point now.
&lt;BR /&gt;Best regards!
&lt;BR /&gt;Pedro</description>
      <pubDate>Wed, 14 Dec 2011 04:02:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341380#M109339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-14T04:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: XML Attribute Namespace, Lookup Tables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341381#M109340</link>
      <description>Hi! 
&lt;BR /&gt;Thanks Pedro. 
&lt;BR /&gt;Basically my output is of the following format: 
&lt;BR /&gt;&amp;lt;root xmlns:xlink="http://www.w3.org/1999/xlink"&amp;gt; 
&lt;BR /&gt;&amp;lt;SomeElement1 id="1" &amp;gt; 
&lt;BR /&gt; &amp;lt;Host xlink:type="simple" xlink:href="nil"/&amp;gt; 
&lt;BR /&gt; ... 
&lt;BR /&gt;&amp;lt;/SomeElement1&amp;gt; 
&lt;BR /&gt;&amp;lt;SomeElement2 id="2"&amp;gt; 
&lt;BR /&gt; &amp;lt;Host xlink:type="simple" xlink:href="#1"/&amp;gt; 
&lt;BR /&gt; ... 
&lt;BR /&gt;&amp;lt;/SomeElement2&amp;gt; 
&lt;BR /&gt;&amp;lt;SomeElement3 id="3"&amp;gt; 
&lt;BR /&gt; &amp;lt;Host xlink:type="simple" xlink:href="#2"/&amp;gt; 
&lt;BR /&gt; ... 
&lt;BR /&gt;&amp;lt;/SomeElement3&amp;gt; 
&lt;BR /&gt;&amp;lt;/root&amp;gt; 
&lt;BR /&gt;Case 1: 
&lt;BR /&gt;I'm using tAdvancedFileOutputXML, my input is an interfaceRegEx. 
&lt;BR /&gt;In the "Configure XML Tree option", I added xlink namespace on the root element. 
&lt;BR /&gt;However there was no way to "specify" a namespace for the attribute "type" in the element "Host". 
&lt;BR /&gt;So i just clicked on add attribute and typed "xlink:type". 
&lt;BR /&gt;My point here is Talend does not intelligently allow me to add a namespace to an attribute. This is however not a problem yet. 
&lt;BR /&gt;Case 2: 
&lt;BR /&gt;In the above XML snippet, you can see that each element is referencing some other element using xlink 
&lt;BR /&gt;SomeElement1 with id="1" is referencing nil. 
&lt;BR /&gt;SomeElement2 with id="2" is referencing SomeElement1 (xlink:href="#1") 
&lt;BR /&gt;SomeElement3 with id="3" is referencing SomeElement3 
&lt;BR /&gt;Now the information of which element references any other element should be stored in a map like this: 
&lt;BR /&gt;key Value 
&lt;BR /&gt;SomeElement1 nil 
&lt;BR /&gt;SomeElement2 #1 
&lt;BR /&gt;SomeElement3 #2 
&lt;BR /&gt;Next in my XML Output, as you can see above, as per the values in the map, I want to populate the xlink:href attribute of the host element. 
&lt;BR /&gt;Example: 
&lt;BR /&gt;when generating 
&lt;BR /&gt;&amp;lt;SomeElement2 id="2"&amp;gt;, it should check the map and retrieve the value #1, and then this value should be populated in the href attribute of its host subelement. 
&lt;BR /&gt;Which component do I use to populate/create a map? 
&lt;BR /&gt;How do I query the map to fill up the values of the href attribute. 
&lt;BR /&gt;Hope I made things clear, and my question is probably very preliminary, in that case only provide the components and approach, I'll try working with it 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 14 Dec 2011 07:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341381#M109340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-14T07:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: XML Attribute Namespace, Lookup Tables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341382#M109341</link>
      <description>Hi&lt;BR /&gt;I feel impossible to retrieve the value from 'SomeElement' dynamically.&lt;BR /&gt;But you may use a lookup input file, set the data as follows.&lt;BR /&gt;Then join two input flows with tMap.&lt;BR /&gt;&lt;PRE&gt;nil&lt;BR /&gt;#1&lt;BR /&gt;#2&lt;BR /&gt;#3&lt;BR /&gt;...&lt;/PRE&gt;&lt;BR /&gt;Still i feel a little confused why you use a tFileInputRegex here and the detail of your input data.&lt;BR /&gt;Welcome to Talend Community.&lt;BR /&gt;Best regards!&lt;BR /&gt;Pedro</description>
      <pubDate>Wed, 14 Dec 2011 10:16:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341382#M109341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-14T10:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: XML Attribute Namespace, Lookup Tables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341383#M109342</link>
      <description>Sorry if I have confused you.&lt;BR /&gt;Let me make it clear.&lt;BR /&gt;Input: A flat file which I'm using RegEx to extract data (details not required)&lt;BR /&gt;Output: XML file.&lt;BR /&gt;The output is the XML file, I'm not trying to "retrieve the value from 'SomeElement' dynamically."&lt;BR /&gt;(1) Given Input from any file, I want to create a map as shown above.&lt;BR /&gt;(2) From the map I want to populate the href field of the xml.</description>
      <pubDate>Wed, 14 Dec 2011 10:53:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341383#M109342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-14T10:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: XML Attribute Namespace, Lookup Tables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341384#M109343</link>
      <description>Hi
&lt;BR /&gt;For case 1, you can right click on the Attribute 'xmlns:link', choose 'Set A Fixed Value' and type '
&lt;A href="http://www.w3.org/1999/xlink" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/1999/xlink&lt;/A&gt;'.
&lt;BR /&gt;For case 2, I can come up with one way. Create a lookup table as follows.
&lt;BR /&gt;
&lt;PRE&gt;id     href&lt;BR /&gt;1      nil&lt;BR /&gt;2      #1&lt;BR /&gt;3      #2&lt;BR /&gt;4      #3&lt;BR /&gt;5      #4&lt;BR /&gt;...&lt;/PRE&gt;
&lt;BR /&gt;Then use component tMap to join your input file and this lookup file.
&lt;BR /&gt;You may find more details in the following images.
&lt;BR /&gt;Best regards!
&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 15 Dec 2011 07:58:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-Attribute-Namespace-Lookup-Tables/m-p/2341384#M109343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-15T07:58:32Z</dc:date>
    </item>
  </channel>
</rss>

