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 (March 2004, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 31 Mar 2004 15:30:10 -0500
Reply-To:     "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject:      Re: SAS and Postgres
Comments: To: Richard DeVenezia <radevenz@IX.NETCOM.COM>

On Wed, 31 Mar 2004 13:25:40 -0500, Richard A. DeVenezia <radevenz@IX.NETCOM.COM> wrote:

>This technique would be applicable to *any* address that can emit xml (rss >feeds, oracle, office, perl, php, jsp,a wireless router?) . Thus the beauty >of xml.

Hi,

Here is the proof-of-concept example, based on the idea -- reading titles of the recent pages from UseModWiki rss feed, tested on version 9.0 on PC.

Richard: I could not make it work without saving the downloaded document locally. Is there any way to directly pipe filename ... url ... to libname ... xml... ?

Cheers, Chang

<sasl:code version="9.0"> %let pwd=%sysfunc(pathname(WORK)); %put pwd=&pwd.;

/* make an xmlmap to extract item titles from changchung.com rss feed */ data _null_; file "&pwd.\titles.xml"; input; put _infile_; cards;

<?xml version="1.0" ?> <XSLEMAP version="1.1"> <TABLE name="TITLES"> <TABLE-PATH syntax="xpath">/rdf:RDF/item</TABLE-PATH> <COLUMN name="title"> <PATH>/rdf:RDF/item/title</PATH> <TYPE>character</TYPE> <DATATYPE>string</DATATYPE> <LENGTH>200</LENGTH> </COLUMN> </TABLE> </XSLEMAP> ; run;

filename UseMod url "http://www.usemod.com:80/cgi-bin/wiki.pl?action=rss"; data _null_; infile UseMod; file "&pwd.\UseMod.xml"; input; put _infile_; run;

filename UseMod "&pwd.\UseMod.xml"; libname UseMod xml xmlmap="&pwd.\titles.xml"; data _null_; set UseMod.titles; put (_all_) (=); run;

libname chang clear; </sasl:code>


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