<?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: Extract an XML attribute from a document in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372924#M135705</link>
    <description>Hi,&lt;BR /&gt;Do you try with tFileInputXML ?</description>
    <pubDate>Thu, 18 Sep 2014 02:24:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-09-18T02:24:00Z</dc:date>
    <item>
      <title>Extract an XML attribute from a document</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372923#M135704</link>
      <description>Hi all, 
&lt;BR /&gt;I have the following setup and I would like to extract the username from this XML. &amp;nbsp;I am currently using tExtractXMLField and I've tried this xpath query&amp;nbsp;/sample/@UserName but I get an error of: 
&lt;BR /&gt;Error on line 1 of document &amp;nbsp;: Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. 
&lt;BR /&gt;It feels like I am missing something. &amp;nbsp;Any assistance would be greatly appreciated. 
&lt;BR /&gt;Thanks!! 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;sample APIVersion="2013.001" SourceServer="abc123" UserName="jsmith" Operation="Search"&amp;gt;&lt;BR /&gt;&amp;lt;Search Guid="red" /&amp;gt;&lt;BR /&gt;&amp;lt;/sample&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Sep 2014 19:19:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372923#M135704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-17T19:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extract an XML attribute from a document</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372924#M135705</link>
      <description>Hi,&lt;BR /&gt;Do you try with tFileInputXML ?</description>
      <pubDate>Thu, 18 Sep 2014 02:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372924#M135705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-18T02:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract an XML attribute from a document</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372925#M135706</link>
      <description>hi, 
&lt;BR /&gt;as Marie_Fr said, it should be easier to use tfileInputXml. 
&lt;BR /&gt;how do you propagate your xml content in tExtractedXmlField ? 
&lt;BR /&gt;What's the value of XML field ? 
&lt;BR /&gt;regards 
&lt;BR /&gt;laurent 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAuR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151712iC74AD30FF852F8D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAuR.png" alt="0683p000009MAuR.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;tExtractXMLField is often use to extract a part of xml document (loop element from complex xml for example).</description>
      <pubDate>Thu, 18 Sep 2014 09:11:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372925#M135706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-18T09:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract an XML attribute from a document</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372926#M135707</link>
      <description>This works for me in 5.6.1:&lt;BR /&gt;tFixedFlowInput &amp;gt; tConvertType &amp;gt; tExtractXMLField &amp;gt; tLogRow&lt;BR /&gt;tFixedFlowInput has line separator "$", field separator "£"&lt;BR /&gt;tConvertType convert string to Document with "automatic conversion" checkbox activated&lt;BR /&gt;tExtractXMLField loop on "/", with one output field "data" with xpath "/sample/@UserName"&lt;BR /&gt;I think that your input XML is invalid, check this with a tLogRow. Maybe a space or a BOM ?</description>
      <pubDate>Tue, 02 Jun 2015 13:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372926#M135707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-02T13:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract an XML attribute from a document</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372927#M135708</link>
      <description>&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&amp;gt; Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;I had the same problem with a tFixedFlowInput and the XML prefixed/suffixed by ".&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Then, if you see a Sax error, check if you have the character " around the XML, and remove it.&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Mon, 13 Jul 2015 13:53:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-an-XML-attribute-from-a-document/m-p/2372927#M135708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-13T13:53:58Z</dc:date>
    </item>
  </channel>
</rss>

