My ride with XML has been rather bumpy till now and it seems I even need to simply reproduce a sample program from the documentation (the item in the title).
I'm running a local installation of SAS 9.2 TS Level 1M0 on a Vista Enterprise workstation with SP1.
Before running the sample program I've copied the suppliers table from the Northwind 2007.accdb sample data base for MS Access to my WORK library.
The sample code with my choice of directories is as follows:
filename xsd 'C:\Users\Raateland\Documents\SAS\XML Testing\suppliers.xsd';
libname output xml 'C:\Users\Raateland\Documents\SAS\XML Testing\suppliers.xml'
xmltype=msaccess xmlmeta=schemadata xmlschema=xsd;
data output.suppliers;
set suppliers;
run;
This runs OK and produces the files suppliers.xsd and suppliers.xml.
The content of suppliers.xsd is just like the xsd-file reproduced in the on-line documentation except for the data, probably because the supplier data in the documentation was taken from an earlier version of MS Access.
Suppliers.xml has one what looks like an important difference compared to the file reproduced in the documentation:
xmlns:od="urn:schemas-microsoft-com:officedata"
xsi:noNamespaceSchemaLocation="suppliers.xsd">
1
Supplier A
....
Line 4 starts with xsi: whereas in the documentation it starts with xs:. Both have xs: in the text on line 2.
When I try to open the XML file (in IE) an error message is produced saying the XML page cannot be displayed. At the end of the error screen text is the line with noNamespaceSchemaLocation. When on a hunch I edit line 4 and remove the i from xsi: making it read xs:, the xml file will be opened by IE without problems.
Unless I edit out the i from xsi: on line 4, XML Mapper will not open the XML file without error either: XML parser encountered XML fatal error (it also mentions the prefix 'xsi' as the cause).
When I try to import the unedited XML file into MS Access 2007, it complains about the same thing: an undefined prefix.
The edited xml file OTOH can be imported into Access 2007 without problems and XML mapper doesn't complain about it either.
I ran into this problem after I had first been trying to work the example given by Richard Foley on page 4 of his paper 'Power Up SAS with XML' without success. The Foley example is also somewhere in the on-line documentation, I think. I can't remember the details of the problems with that example, though.
The XML Mapper I've installed is the latest from the SI site.
The end purpose of my XML tests is finding out how to produce XML files with content from appropriate SAS data sets when we're just given their schema files. I don't know yet how complicated these schemas will be. For now it feels like quite a challenge.
Thanks for your kind help and information.
Arjen Raateland
Finnish Environment Institute, Helsinki
... View more