<?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: Generating XML from QVD, double quotes in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499763#M1226339</link>
    <description>&lt;P&gt;does this help:&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/use-quotes-in-script.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/use-quotes-in-script.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;What happens if you use single quotes?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 13:49:48 GMT</pubDate>
    <dc:creator>David_Friend</dc:creator>
    <dc:date>2025-01-02T13:49:48Z</dc:date>
    <item>
      <title>Generating XML from QVD, double quotes</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499760#M1226338</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;trying generate XML file from QVD file, but have problems with&amp;nbsp;quotes.&lt;BR /&gt;&lt;BR /&gt;IF in code i write -&amp;nbsp;'&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;'&lt;BR /&gt;&lt;BR /&gt;at result file i get "&amp;lt;?xml version=""1.0"" encoding=""UTF-8""?&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;and in data rows, where are values i need values insert in&amp;nbsp;quotes ("xxx"), but finally get ""xxx""&lt;BR /&gt;&lt;BR /&gt;Here is my script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SET vSourceFile = 'xxx.qvd';
SET vOutputFile = 'xxx.xml';

TempXML:
LOAD
    '&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;' AS XML_LINE
AUTOGENERATE 1;

CONCATENATE (TempXML)
LOAD
    '&amp;lt;ROOT&amp;gt;&amp;lt;InitStocks&amp;gt;' AS XML_LINE
AUTOGENERATE 1;

STOCK_DATA:
LOAD 
    CUST_ID,
    STATUS,
    DTLM,
    STOCK,
    LOT_ID,
    LOCALCODE,
    WAREH_CODE
FROM $(vSourceFile) (qvd);

FOR i = 0 TO NoOfRows('STOCK_DATA') - 1
    LET vXMLRow = '&amp;lt;InitStock CUST_ID=' &amp;amp; Trim(Peek('CUST_ID', i, 'STOCK_DATA')) &amp;amp; ' ' &amp;amp;
                  'STATUS=' &amp;amp; Trim(Peek('STATUS', i, 'STOCK_DATA')) &amp;amp; ' ' &amp;amp;
                  'DTLM=' &amp;amp; Trim(Peek('DTLM', i, 'STOCK_DATA')) &amp;amp; ' ' &amp;amp;
                  'STOCK=' &amp;amp; Trim(Peek('STOCK', i, 'STOCK_DATA')) &amp;amp; ' ' &amp;amp;
                  'LOT_ID=' &amp;amp; Trim(Peek('LOT_ID', i, 'STOCK_DATA')) &amp;amp; ' ' &amp;amp;
                  'LOCALCODE=' &amp;amp; Trim(Peek('LOCALCODE', i, 'STOCK_DATA')) &amp;amp; ' ' &amp;amp;
                  'WAREH_CODE=' &amp;amp; Trim(Peek('WAREH_CODE', i, 'STOCK_DATA')) &amp;amp; ' /&amp;gt;';
    CONCATENATE (TempXML)
    LOAD '$(vXMLRow)' AS XML_LINE AUTOGENERATE 1;
NEXT;

CONCATENATE (TempXML)
LOAD '&amp;lt;/InitStocks&amp;gt;&amp;lt;/ROOT&amp;gt;' AS XML_LINE
AUTOGENERATE 1;

STORE TempXML INTO [$(vOutputFile)] (txt);
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tryed use Chr(34), But nothing helps.&lt;BR /&gt;&lt;BR /&gt;If here i write " -&amp;nbsp;&amp;nbsp;'STATUS=&lt;FONT color="#FF0000"&gt;"&lt;/FONT&gt;' &amp;amp; Trim(Peek('STATUS', i, 'STOCK_DATA')) &amp;amp; '&lt;FONT color="#FF0000"&gt;"&lt;/FONT&gt; ' &amp;amp;&lt;BR /&gt;&lt;BR /&gt;in xml&amp;nbsp; i get:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;"&lt;/FONT&gt;&amp;lt;InitStock CUST_ID=6 STATUS=&lt;FONT color="#FF0000"&gt;""&lt;/FONT&gt;2&lt;FONT color="#FF0000"&gt;""&lt;/FONT&gt; DTLM=20241223 04:41 STOCK=168.0000 LOT_ID=0 LOCALCODE=4860019001421 WAREH_CODE=EN1 /&amp;gt;&lt;FONT color="#FF0000"&gt;"&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------------------------------&lt;BR /&gt;Now are writed macro, but i want remove the macro and make all in one script&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snaigius213_0-1735824931955.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176143iCB21A2A4D357E643/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snaigius213_0-1735824931955.png" alt="Snaigius213_0-1735824931955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 13:35:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499760#M1226338</guid>
      <dc:creator>Snaigius213</dc:creator>
      <dc:date>2025-01-02T13:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Generating XML from QVD, double quotes</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499763#M1226339</link>
      <description>&lt;P&gt;does this help:&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/use-quotes-in-script.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/use-quotes-in-script.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;What happens if you use single quotes?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 13:49:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499763#M1226339</guid>
      <dc:creator>David_Friend</dc:creator>
      <dc:date>2025-01-02T13:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Generating XML from QVD, double quotes</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499766#M1226340</link>
      <description>&lt;P&gt;I try search many info.&lt;/P&gt;
&lt;P&gt;but if use single&amp;nbsp;&lt;SPAN&gt;quotes, i get the same :&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snaigius213_0-1735826055350.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176145iE0447729636382BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snaigius213_0-1735826055350.png" alt="Snaigius213_0-1735826055350.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 13:54:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499766#M1226340</guid>
      <dc:creator>Snaigius213</dc:creator>
      <dc:date>2025-01-02T13:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Generating XML from QVD, double quotes</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499805#M1226342</link>
      <description>&lt;P&gt;AFAIK it's not possible. Not because the Qlik-load wouldn't be able to create the wanted data-structure else the provided store-feature into a txt has no configurations in regard to the quote-handling. As far as there are any quotes they will be embedded with further ones.&lt;/P&gt;
&lt;P&gt;Depending on the target you may replace the quotes with other chars and advising the target which chars are now which kind of quotes and/or using the feature that some targets interpret n following quotes as one quote - both are more theoretically possibilities as practically solutions ...&lt;/P&gt;
&lt;P&gt;Another look may go to store the data into a *.qvx - which creates a xml but I never tried that in such a way and it may come with any other overhead ...&lt;/P&gt;
&lt;P&gt;Therefore you may remain by the macro or involving any extra tool/batch in between the source and the target which adjusted/replaced the wrong quotes.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 15:52:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499805#M1226342</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-01-02T15:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generating XML from QVD, double quotes</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499864#M1226343</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Tried all I could think of, and indeed not possible within Qlik, so I used powershell commands to replace these chars.&lt;BR /&gt;&lt;BR /&gt;Replaced all wanted " with ### in the Qlik script, and used Powershell to replace them for the correct one.&lt;BR /&gt;&lt;BR /&gt;For example&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TempXML:
LOAD
'&amp;lt;?xml version=###1.0### encoding=###UTF-8###?&amp;gt;' AS XML_LINE
AUTOGENERATE 1;&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Content of&amp;nbsp;_ConvertSteps.ps1&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(Get-Content Qlikraw.xml) -replace '"', '' | Out-File -encoding ASCII XMLStep1.xml
(Get-Content XMLStep1.xml) -replace '###', '"' | Out-File -encoding ASCII Import.xml
Del Qlikraw.xml
Del XMLStep1.xml&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EXECUTE POWERSHELL.EXE /C C:\QlikView\XMLOutput\_ConvertSteps.ps1;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 10:40:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-XML-from-QVD-double-quotes/m-p/2499864#M1226343</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2025-01-03T10:40:59Z</dc:date>
    </item>
  </channel>
</rss>

