<?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 XML question:  How do I place xmlns:xsi into my schema? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XML-question-How-do-I-place-xmlns-xsi-into-my-schema/m-p/783516#M249839</link>
    <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to generate a bunch of XML files for a mail-out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to change the root tag from &amp;lt;TABLE&amp;gt; to &amp;lt;RECORD&amp;gt;. I also need to have this tag: &amp;lt;Data xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xsi:schemaLocation="1900C.xsd"&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*This is a simplified example of the code I'm using*/

LIBNAME xmlout XML "&amp;amp;path.\HAVE.xml" xmlencoding="utf-8" tagset=tagsets.sasxmiss;

data xmlout.Recorddata;
	set Addresses;
	keep FormID SequenceNumber ClientCorrespondenceLanguage ClientIdentificationNumber 
		 ClientName ClientAddress1 ClientAddress2 ClientAddress3;
run;

THIS IS THE OUTPUT I HAVE

&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;TABLE&amp;gt;
   &amp;lt;RECORDDATA&amp;gt;
      &amp;lt;FormID&amp;gt;1111&amp;lt;/FormID&amp;gt;
      &amp;lt;SequenceNumber&amp;gt;00000001&amp;lt;/SequenceNumber&amp;gt;
      &amp;lt;ClientCorrespondenceLanguage&amp;gt;E&amp;lt;/ClientCorrespondenceLanguage&amp;gt;
      &amp;lt;ClientIdentificationNumber&amp;gt;111111111&amp;lt;/ClientIdentificationNumber&amp;gt;
      &amp;lt;ClientName&amp;gt;John Doe&amp;lt;/ClientName&amp;gt;
      &amp;lt;ClientAddress1&amp;gt;1 ELM ST&amp;lt;/ClientAddress1&amp;gt;
      &amp;lt;ClientAddress2&amp;gt;ANYWHERE PE C1C 1C1&amp;lt;/ClientAddress2&amp;gt;
      &amp;lt;ClientAddress3/&amp;gt;
   &amp;lt;/RECORDDATA&amp;gt;
&amp;lt;/TABLE&amp;gt;

THIS IS THE OUTPUT I WANT

&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="1900C.xsd"&amp;gt;
 &amp;lt;Records&amp;gt;
   &amp;lt;RECORDDATA&amp;gt;
      &amp;lt;FormID&amp;gt;1111&amp;lt;/FormID&amp;gt;
      &amp;lt;SequenceNumber&amp;gt;00000001&amp;lt;/SequenceNumber&amp;gt;
      &amp;lt;ClientCorrespondenceLanguage&amp;gt;E&amp;lt;/ClientCorrespondenceLanguage&amp;gt;
      &amp;lt;ClientIdentificationNumber&amp;gt;111111111&amp;lt;/ClientIdentificationNumber&amp;gt;
      &amp;lt;ClientName&amp;gt;John Doe&amp;lt;/ClientName&amp;gt;
      &amp;lt;ClientAddress1&amp;gt;1 ELM ST&amp;lt;/ClientAddress1&amp;gt;
      &amp;lt;ClientAddress2&amp;gt;ANYWHERE PE C1C 1C1&amp;lt;/ClientAddress2&amp;gt;
      &amp;lt;ClientAddress3/&amp;gt;
   &amp;lt;/RECORDDATA&amp;gt;
 &amp;lt;/Records&amp;gt;&lt;/PRE&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Dec 2021 02:41:28 GMT</pubDate>
    <dc:creator>demetri0</dc:creator>
    <dc:date>2021-12-02T02:41:28Z</dc:date>
    <item>
      <title>XML question:  How do I place xmlns:xsi into my schema?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-question-How-do-I-place-xmlns-xsi-into-my-schema/m-p/783516#M249839</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to generate a bunch of XML files for a mail-out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to change the root tag from &amp;lt;TABLE&amp;gt; to &amp;lt;RECORD&amp;gt;. I also need to have this tag: &amp;lt;Data xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xsi:schemaLocation="1900C.xsd"&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*This is a simplified example of the code I'm using*/

LIBNAME xmlout XML "&amp;amp;path.\HAVE.xml" xmlencoding="utf-8" tagset=tagsets.sasxmiss;

data xmlout.Recorddata;
	set Addresses;
	keep FormID SequenceNumber ClientCorrespondenceLanguage ClientIdentificationNumber 
		 ClientName ClientAddress1 ClientAddress2 ClientAddress3;
run;

THIS IS THE OUTPUT I HAVE

&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;TABLE&amp;gt;
   &amp;lt;RECORDDATA&amp;gt;
      &amp;lt;FormID&amp;gt;1111&amp;lt;/FormID&amp;gt;
      &amp;lt;SequenceNumber&amp;gt;00000001&amp;lt;/SequenceNumber&amp;gt;
      &amp;lt;ClientCorrespondenceLanguage&amp;gt;E&amp;lt;/ClientCorrespondenceLanguage&amp;gt;
      &amp;lt;ClientIdentificationNumber&amp;gt;111111111&amp;lt;/ClientIdentificationNumber&amp;gt;
      &amp;lt;ClientName&amp;gt;John Doe&amp;lt;/ClientName&amp;gt;
      &amp;lt;ClientAddress1&amp;gt;1 ELM ST&amp;lt;/ClientAddress1&amp;gt;
      &amp;lt;ClientAddress2&amp;gt;ANYWHERE PE C1C 1C1&amp;lt;/ClientAddress2&amp;gt;
      &amp;lt;ClientAddress3/&amp;gt;
   &amp;lt;/RECORDDATA&amp;gt;
&amp;lt;/TABLE&amp;gt;

THIS IS THE OUTPUT I WANT

&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="1900C.xsd"&amp;gt;
 &amp;lt;Records&amp;gt;
   &amp;lt;RECORDDATA&amp;gt;
      &amp;lt;FormID&amp;gt;1111&amp;lt;/FormID&amp;gt;
      &amp;lt;SequenceNumber&amp;gt;00000001&amp;lt;/SequenceNumber&amp;gt;
      &amp;lt;ClientCorrespondenceLanguage&amp;gt;E&amp;lt;/ClientCorrespondenceLanguage&amp;gt;
      &amp;lt;ClientIdentificationNumber&amp;gt;111111111&amp;lt;/ClientIdentificationNumber&amp;gt;
      &amp;lt;ClientName&amp;gt;John Doe&amp;lt;/ClientName&amp;gt;
      &amp;lt;ClientAddress1&amp;gt;1 ELM ST&amp;lt;/ClientAddress1&amp;gt;
      &amp;lt;ClientAddress2&amp;gt;ANYWHERE PE C1C 1C1&amp;lt;/ClientAddress2&amp;gt;
      &amp;lt;ClientAddress3/&amp;gt;
   &amp;lt;/RECORDDATA&amp;gt;
 &amp;lt;/Records&amp;gt;&lt;/PRE&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 02:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-question-How-do-I-place-xmlns-xsi-into-my-schema/m-p/783516#M249839</guid>
      <dc:creator>demetri0</dc:creator>
      <dc:date>2021-12-02T02:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: XML question:  How do I place xmlns:xsi into my schema?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-question-How-do-I-place-xmlns-xsi-into-my-schema/m-p/783561#M249872</link>
      <description>&lt;P&gt;A bit of post-processing:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
 infile "&amp;amp;wdir\have.xml" ;
 file "&amp;amp;wdir\want.xml";
 input;
 if _INFILE_='&amp;lt;TABLE&amp;gt;' then put '&amp;lt;Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="1900C.xsd"&amp;gt;'
    '0d0a'x '&amp;lt;Records&amp;gt;';
 else if _INFILE_='&amp;lt;/TABLE&amp;gt;' then put '&amp;lt;/Records&amp;gt;';
 else put _INFILE_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 08:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-question-How-do-I-place-xmlns-xsi-into-my-schema/m-p/783561#M249872</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-12-02T08:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: XML question:  How do I place xmlns:xsi into my schema?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-question-How-do-I-place-xmlns-xsi-into-my-schema/m-p/783593#M249893</link>
      <description>&lt;P&gt;Perfect!&amp;nbsp; Thanks very much.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 12:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-question-How-do-I-place-xmlns-xsi-into-my-schema/m-p/783593#M249893</guid>
      <dc:creator>demetri0</dc:creator>
      <dc:date>2021-12-02T12:07:05Z</dc:date>
    </item>
  </channel>
</rss>

