LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 16 Dec 2004 23:48:36 GMT
Reply-To:   Alan Churchill <EMAILDIRECTLY@SAVIANSOFTWARE.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Alan Churchill <EMAILDIRECTLY@SAVIANSOFTWARE.COM>
Subject:   Re: XML, XMLMap, and DTD

I would suggest 2 possible approaches:

1. Download the trial version of XMLSpy and do the conversion. www.altova.com 2. Instead of using one of the languages suggested below, I would look at using a .net based language due to .net's incredible support for xml. For example, here are the statements (C#) to read an XML file into memory :

DataSet ds=new DataSet() ; ds.ReadXml(@"c:\temp\datatoread.xml") ;

If you need a complete program, let me know.

Thanks, Alan Savian "Bridging SAS and Microsoft Technologies"?

nntp://news.qwest.net/comp.soft-sys.sas/ Kevin Christensen wrote: > SAS-L Index - 15 Dec 2004 - Special issue (#2004-1651)I have a rather large, > concatenated XML file that I would like to read into SAS. I have tried the > XML Libname but it didn't work because the XML file relies on DTD. I have > tried using XMLMap but got an error when trying to open the file in XMLMap. > I'm not sure why I got that error. I have the dtd file. Is there a way to > use the dtd file and somehow easily convert the XML file into a sas dataset?

I think the DTD is likely to defeat you here. SAS is still working to get its XML act together.

I would recommend that you tackle this in another language, just to save yourself headaches. Perl, Python, Java, _et_al._ have good XML reading capabilities. If you do this in Perl, just grab a good XML module like XML::Parser and let the imported functions do the rest. Here's an article I read recently which might help you if you want to play with XML (using Perl) from the command line (which means you have a STDOUT which can be piped right into a SAS DATA step if you want to).

http://www.xml.com/pub/a/2002/04/17/perl-xml.html

HTH, David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician

[comp.soft-sys.sas]


Back to: Top of message | Previous page | Main SAS-L page