LIBNAME Statement for the XML Engine |
About the XML Engine Versions |
SAS 9.2 provides two versions for XML LIBNAME engine functionality by implementing engine nicknames in the LIBNAME statement.
By specifying the engine nickname XML, you access the SAS 9.1.3 XML engine functionality.
By specifying the engine nickname XML92, you access the new SAS 9.2 XML engine functionality with enhancements and changes. For example, the XML92 version provides enhanced LIBNAME statement functionality, new XMLMap functionality, and diagnostics of obsolete syntax.
The major differences between the versions include the following:
The XML92 version is XML compliant.
LIBNAME statement functionality enhancements for XML92 include the WSDL and XMLMAP markup types, additional options, and the ability to assign a libref to a SAS library.
New XMLMap functionality for XML92 includes the ability to use an XMLMap for exporting.
Comparing the XML Engine Versions: XML92 and XML |
The XML92 version is XML compliant, which means that XML92 requires XML markup to be well-formed and in valid construction that is in compliance with the W3C specifications. Because the XML92 version is XML compliant, using XML92 could affect the following situations:
XML documents that are imported with the XML version might not pass the more strict parsing rules in the XML92 version. For example, like XML markup, the XML92 version is case sensitive. Opening and closing tags must be written in the same case, such as <BODY> ...</BODY> and <Message>...</Message>. For the XML92 version, the tag <Letter> is different from the tag <letter>. Attribute names are also case sensitive, and the attribute value must be enclosed in quotation marks, such as <Note date="09/24/1975">.
XMLMap files that are accepted by the XML version might not work with the XML92 version. The XML92 version requires that XMLMap files be XML compliant, which means that the markup is case sensitive. In addition, the XMLMap markup must follow the specific XMLMap rules. Tag names must be uppercase. Element attributes must be lowercase. An example is <SXLEMAP version="1.9">. In addition, the supported XPath syntax is case sensitive.
The XML version supports all XMLMap files starting with XMLMap version 1.0. The XML92 version supports XMLMap files starting with XMLMap version 1.2. The documented XMLMap syntax version is 1.9. See XMLMap Syntax Version 1.9.
The XML92 version provides the following LIBNAME statement functionality:
The ability to assign a libref to a SAS library, rather than assigning the libref to a specific XML document. See SAS-library.
Additional XML markup types such as WSDL and XMLMAP. See XMLTYPE=.
Additional options. For a list of the LIBNAME statement options that are available for the XML and XML92 nicknames, see LIBNAME Statement Options.
Using the XML92 version and the GENERIC markup type, you can export an XML document from multiple SAS data sets. For example, if you have two SAS data sets named Grades.Fred and Grades.Wilma, the following code exports an XML document named Grades.xml that includes the grades from both SAS data sets:
libname stones xml92 'c:\Grades.xml'; data stones.fred; set grades.fred; run; data stones.wilma; set grades.wilma; run;
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.