Sample 38052: How to modify the root node generated by default when creating output using the XML LIBNAME engine
To modify the root node generated with output created with the XML LIBNAME engine, the ODS Markup Language can be used to create a new tagset. The new tagset will be supplied on the LIBNAME statement using the TAGSET= option. The TAGSETS.SASXMOG can be modified, updating the SASTable event. The MVAR statement can be added to the new tagset, which supplies a macro variable that can be dynamically supplied within the program. By default, this root node is <TABLE> in SAS 9.2 (TS2M0).
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to modify the root node which is generated by default when generating output using the XML LIBNAME engine.
/* We will compile a new tagset which is tagsets.nameroot. */
/* Once you compile this, you can specify a macro variable */
/* to change the root name. If the root name is not changed, */
/* the default is used. */
proc template;
define tagset tagsets.nameroot;
parent=tagsets.sasxmog;
mvar tablename;
notes "SAS-XML generic XML-Data";
define event SASTable;
start:
put "<";
do / if !exist(tablename);
put TEXT;
else;
put tablename;
done;
put ">" NL;
break;
finish:
put "</";
do / if !exist(tablename);
put TEXT;
else;
put tablename;
done;
put ">" NL;
break;
end;
end;
run;
%let tablename=TEST;
libname temp xml 'c:\temp\trash\temp.xml' tagset=tagsets.nameroot;
proc copy in=sashelp out=temp;
select class;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to modify the root node which is generated by default when creating output using the XML LIBNAME engine.
| Type: | Sample |
| Topic: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> XML
|
| Date Modified: | 2010-02-03 14:31:00 |
| Date Created: | 2009-12-06 22:31:39 |
Operating System and Release Information
| SAS System | Base SAS | z/OS | 9.1 TS1M0 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
| Microsoft Windows NT Workstation | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |
| Microsoft Windows XP Professional | 9.1 TS1M0 | |
| 64-bit Enabled AIX | 9.1 TS1M0 | |
| 64-bit Enabled HP-UX | 9.1 TS1M0 | |
| 64-bit Enabled Solaris | 9.1 TS1M0 | |
| HP-UX IPF | 9.1 TS1M0 | |
| Linux | 9.1 TS1M0 | |
| OpenVMS Alpha | 9.1 TS1M0 | |
| Tru64 UNIX | 9.1 TS1M0 | |