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 (October 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 28 Oct 2009 16:03:55 -0500
Reply-To:     matt.pettis@THOMSONREUTERS.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Matthew Pettis <matt.pettis@THOMSONREUTERS.COM>
Subject:      Re: reading in XML data
Comments: To: eli@ACERCORNER.COM
In-Reply-To:  <>
Content-Type: text/plain; charset="us-ascii"

There is -- you can use the libname XML statement to read this in, but you need an associated .map file to tell the XML engine the data layout. Do you have 'SAS XML Mapper' installed? If so, you can take a sample .xml file and use that and the app to create an appropriate map file. I'll assume you don't have it handy right yet and whip one out and send it back to you -- takes about 5min...


-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Eli Kling Sent: Wednesday, October 28, 2009 5:40 AM To: SAS-L@LISTSERV.UGA.EDU Subject: reading in XML data

I am having trouble reading an xml file I got from a client (well I have 50 of them). Before I go to the good old data step and parse it myself, I wonder if there is an elegant way of doing this. The structure is a follows:

<?xml version="1."?> <test> <frame value="1"> <node name="node1"> <attribute name="a1" value="1"></attribute> <attribute name="a2" value="0"></attribute> <attribute name="a3" value="0"></attribute> <attribute name="a4" value="0"></attribute> <attribute name="a5" value="4.681483335"></attribute> <attribute name="a6" value="1.870251177"></attribute> <attribute name="a7" value="7.635592512"></attribute> <attribute name="a8" value="1"></attribute> <attribute name="a9" value="1"></attribute> <attribute name="a10" value="1"></attribute> </node> <node name="node2"> <attribute name="a1" value="1"></attribute> <attribute name="a2" value="-0.009869254665"></attribute> <attribute name="a20" value="0.03694603221"></attribute> <attribute name="a21" value="0.1336173431"></attribute> <attribute name="a6" value="0"></attribute> <attribute name="a10" value="0"></attribute> <attribute name="a17" value="0"></attribute> <attribute name="a50" value="1"></attribute> <attribute name="a55" value="1"></attribute> <attribute name="a56" value="1"></attribute> </node>

Yes, each node has its own attributes where some are shared - but this is probably a read hering.

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