<?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 file validation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427173#M105323</link>
    <description>&lt;P&gt;So, you open the XML file you already have in XML mapper?&amp;nbsp; In which case you are in the process of creating the map file.&amp;nbsp; The XML mapper is a tool designed to map the XML file into a dataset, the output map can then be used in code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your error, are you up to date with EG?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jan 2018 13:09:45 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-01-12T13:09:45Z</dc:date>
    <item>
      <title>XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426817#M105204</link>
      <description>&lt;P&gt;I've a requirement to convert a SAS dataset to XML file. Although I could do this, I'm not certain on how to validate the XML file to know whether the conversion has happened rightly. Appreciate if someone of you guide me to know the way to validate the XML file.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 10:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426817#M105204</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-11T10:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426824#M105207</link>
      <description>&lt;P&gt;What do you mean by validate?&amp;nbsp; This could mean:&lt;/P&gt;
&lt;P&gt;Syntax checking the XML to ensure it is well structured.&lt;/P&gt;
&lt;P&gt;Validating the XML against a DSD to ensure rules are followed.&lt;/P&gt;
&lt;P&gt;Checking the data against the data in your dataset to ensure the write was correct.&lt;/P&gt;
&lt;P&gt;Plus maybe others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For syntax (and DSD, though you did not mention you had one), then you can use any of the XML tools out there, for instance an online one:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.xmlvalidation.com/" target="_blank"&gt;https://www.xmlvalidation.com/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To check the data, you would need to do one of the following:&lt;BR /&gt;Read the data back in and proc compare&lt;/P&gt;
&lt;P&gt;Get someone else to program the XML output and text compare the output files&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 10:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426824#M105207</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-11T10:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426826#M105208</link>
      <description>&lt;P&gt;I've a XML Mapper installed in my machine. Is there is an way to validate the XML file in &lt;SPAN&gt;XML Mapper&lt;/SPAN&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 10:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426826#M105208</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-11T10:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426828#M105209</link>
      <description>&lt;P&gt;That is the small free tool from SAS right?&amp;nbsp; If so that is just for building the scheme to import data from XML, don't think it does anything else.&amp;nbsp; There are loads of tools out there, like the online one I sent.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 10:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426828#M105209</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-11T10:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426866#M105214</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;The question is: What do you want to validate against? A DTD, an XSD,...?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is an XSD and you need to convert a SAS table to XML which complies with this XSD:&lt;/P&gt;
&lt;P&gt;You can use the SAS XML Mapper to generate a SAS XMLMap.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 181px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17796i6D01CEAB316F7F44/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You then use this SAS XMLMap as part of your libname statement with the XML engine to generate the XML.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/48/825.html&amp;nbsp;" target="_blank"&gt;http://support.sas.com/kb/48/825.html&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for validating the generated XML against the XSD which SAS used to generate the XML:&lt;/P&gt;
&lt;P&gt;You can't really use SAS to test if SAS got it right. So if you really want to validate the generated XML against the XSD the you need to use some 3rd party product. There is for example Java stuff out there which can do such validation.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 13:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/426866#M105214</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-01-11T13:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427171#M105322</link>
      <description>&lt;P&gt;I want to create the mapping file from XML file. I've opened the XML file from SAS XML Mapper and then I went on to see the tab 'XML map'. But I'm not certain whether that is the mapping file. Could you please give me some insights here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an alternate option, I tried the following code in SAS EG 7.12, but I end up with error as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;24         libname xmlfile xmlv2 xmlmap=mapfile automap=replace;
ERROR: The XMLV2 engine cannot be found.
ERROR: Error in the LIBNAME statement.
25         
26         proc copy in=xmlfile out=work;
27         run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jan 2018 12:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427171#M105322</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-12T12:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427173#M105323</link>
      <description>&lt;P&gt;So, you open the XML file you already have in XML mapper?&amp;nbsp; In which case you are in the process of creating the map file.&amp;nbsp; The XML mapper is a tool designed to map the XML file into a dataset, the output map can then be used in code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your error, are you up to date with EG?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 13:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427173#M105323</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-12T13:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427175#M105325</link>
      <description>&lt;P&gt;Appreciate if you could expand this sentence by referencing the documentation.&amp;nbsp;&lt;EM&gt;'The XML mapper is a tool designed to map the XML file into a dataset, the output map can then be used in code'&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not upto date in SAS EG. I've not used XML file in the past and therefore seeking your help.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 13:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427175#M105325</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-12T13:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427181#M105327</link>
      <description>&lt;P&gt;See:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=engxml&amp;amp;docsetTarget=p0p9yojzxlnvt8n1xyigzqu0orxb.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=engxml&amp;amp;docsetTarget=p0p9yojzxlnvt8n1xyigzqu0orxb.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your EG version is not current enough to include the xmlv2 engine then try the xml engine:&lt;/P&gt;
&lt;P&gt;libname tmp xml "....xml";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you may have to read and parse it yourself, depending on the complexity.&amp;nbsp; Does the file open in Excel?&amp;nbsp; A lot of the time Excel's XML reader can process it for you and then you could save as CSV file and import that.&amp;nbsp; Might be simpler.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 13:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427181#M105327</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-12T13:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427186#M105330</link>
      <description>&lt;P&gt;I've used the following code to generate the mapping file, but I end with error as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;24         filename mapfile  '/GTU/dynamic.map';
25         filename testfile '/GTU/dynamic.xml';
26         
27         libname xmlfile xml xmlmap=mapfile /*automap=replace*/;
NOTE: Libref XMLFILE was successfully assigned as follows: 
      Engine:        XML 
      Physical Name: 
28         
29         proc copy in=xmlfile out=work;
30         run;

ERROR: Physical file does not exist, /GTU/dynamic.map.
       encountered during XMLMap parsing
       occurred at or near line 1, column 1
ERROR: XML describe error: Internal processing error.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also please let me know how can I create the mapping file from Excel?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 13:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427186#M105330</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-12T13:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427192#M105335</link>
      <description>&lt;P&gt;Sorry, you don't seem to understand.&amp;nbsp; A map file is associated with an XML file, it is the map from XML to dataset.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; mapfile  &lt;SPAN class="token string"&gt;'/GTU/dynamic.map'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does not exist, this is what you should be creating from XML mapper, it is the map between XML and dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My other suggestion was that you open the XML file in Excel and use Excel to save the data to CSV - nothing to do with XML, maps or anything else.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 14:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427192#M105335</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-12T14:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: XML file validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427597#M105503</link>
      <description>&lt;P&gt;Could you please help me understand on the next steps once I create the map file from SAS XML Mapper?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 04:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-validation/m-p/427597#M105503</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-15T04:04:37Z</dc:date>
    </item>
  </channel>
</rss>

