Hi, I was trying parse a xml feed from the St. Louis Fed Reserve Bank database (FRED) (see api @ http://api.stlouisfed.org/docs/fred/series_observations.html.) using Oleg's x2j sax parser.
I tried the various examples on the wiki as well as the one in the email below, and I kept getting the following error. process_px2j4_ TESTX2J4 |domain error: ParserCreate | PARSER=: ParserCreate<<0 When I finally hunted down the problem there was a reference to a 64bit dll that doesn't exist. fexist 'C:\j64-602\addons\xml\sax\lib\libexpat64.dll' 0 I was able to download a copy of the expat64 dll from http://www.gtk.org/download-windows-64bit.html (see Third party dependencies). It required renaming the dll to libexpat64.dll and putting it in ~addons\xml\sax\lib. Once I did this, everything worked perfectly. Thanks for great tool Oleg! I just wanted to point out this problem, so the addon can be fixed in JAL. Thanks, Ken -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Tom Arneson Sent: Saturday, September 05, 2009 11:43 AM To: 'Programming forum' Subject: Re: [Jprogramming] x2j (XML to J) - innovative declarative wayto parse XML Oleg, Thanks for the encouragement. Here is my first working solution: NB. --------------------------------------------------------- NB. fragment of gpx file testgpx=: 0 : 0 <gpx> <wpt lat="42.13350000" lon="-88.97320000"> <time>2009-08-24T01:03:09Z</time> <name>99BYTH</name> <desc>120 farm</desc> <link href="http://geodashing.gpsgames.org/cgi-bin/dp.pl?dp=GD99-BYTH"> <text>GD99-BYTH</text> <type>text/html</type> </link> <sym>Geocache</sym> <type>Geocache|Virtual Cache</type> <extensions> <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3"> <label_text>99BYTH</label_text> <text xmlns="http://www.topografix.com/GPX/gpx_style/0/2"> <font> <family generic="sans-serif"> <face>Arial</face> </family> </font> </text> </label> </extensions> </wpt> <wpt lat="45.84690000" lon="-88.47240000"> <time>2009-08-24T01:03:09Z</time> <name>99BYYL</name> <desc>280 woods</desc> <link href="http://geodashing.gpsgames.org/cgi-bin/dp.pl?dp=GD99-BYYL"> <text>GD99-BYYL</text> <type>text/html</type> </link> <sym>Geocache</sym> <type>Geocache|Virtual Cache</type> <extensions> <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3"> <label_text>99BYYL</label_text> <text xmlns="http://www.topografix.com/GPX/gpx_style/0/2"> <font> <family generic="sans-serif"> <face>Arial</face> </family> </font> </text> </label> </extensions> </wpt> </gpx> ) NB. --------------------------------------------------------- require 'xml/sax/x2j' x2jclass 'px2jgpxway' 'Items' x2jDefn / := table : table=: ,:'latitude';'longitude';'name';'description' wpt := table=: table,lat;lon;t;d : 'lat lon'=: atr each;:'lat lon' wpt/name := t=: y wpt/desc := d=: y ) cocurrent 'base' smoutput z=: process_px2jgpxway_ testgpx ------------T------------T------T-----------┐ │latitude │longitude │name │description│ +-----------+------------+------+-----------+ │42.13350000│-88.97320000│99BYTH│120 farm │ +-----------+------------+------+-----------+ │45.84690000│-88.47240000│99BYYL│280 woods │ L-----------+------------+------+------------ -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Oleg Kobchenko Sent: Saturday, September 05, 2009 04:59 To: Programming forum Subject: Re: [Jprogramming] x2j (XML to J) - innovative declarative way to parse XML This is very similar to http://www.jsoftware.com/jwiki/Addons/xml/sax/x2j%20Examples#x2j4.ijs I don't want to spoil your fun. Seriously. Give it a try and let us know how it goes. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
