expat XML parser binding

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

expat XML parser binding

Jay Carlson
I've put a simple binding of expat, James Clark's C stream-based XML parser
up at http://www.place.org/~nop/lxp.tar.gz .  No, not everything is bound,
but it should be obvious how to bind more stuff to it.

BTW, list rep of <methodCall kind="xuxu"> as {xml="methodCall", kind="xuxu"}
requires great care in the presence of tinsert/tremove, or you won't be able
to have attributes named "n".  I'm leaning towards {"methodCall";
attr={kind="xuxu}}, with contained elements from postion 2 onwards.  Of
course, lxp doesn't have any opinion, because it just does
starttag/endtag....

Jay


Reply | Threaded
Open this post in threaded view
|

Re: expat XML parser binding

Steve Dekorte-4

On Sunday, November 25, 2001, at 09:05  PM, Jay Carlson wrote:
I've put a simple binding of expat, James Clark's C stream-based XML parser up at http://www.place.org/~nop/lxp.tar.gz . No, not everything is bound,
but it should be obvious how to bind more stuff to it.

Thanks Jay - this is a really useful binding.

If Lua also had a binding for libcurl(http://curl.haxx.se/libcurl/) it would be possible to do some really cool web scripting. In the meantime execute("curl https:...") works ok.

Steve



Reply | Threaded
Open this post in threaded view
|

Re: expat XML parser binding

Jay Carlson
> If Lua also had a binding for libcurl(http://curl.haxx.se/libcurl/) it
> would be possible to do some really cool web scripting. In the meantime
> execute("curl https:...") works ok.

I can top that for grossness:

local rv = execute("POST -c 'text/xml' -H 'User-Agent: LuaXMLRPC/0.0' -H
'Host: "..host.."' " ..url .. "</tmp/a >/tmp/b")

where /usr/bin/POST came from libwww-perl, or at least that's what the
Debian package tools say...

I'll take a look at libcurl right after I get LuaSocket built.

Jay


Reply | Threaded
Open this post in threaded view
|

Re: expat XML parser binding

Martin Spernau
In reply to this post by Jay Carlson
I just stumbled over this... maybe the lxp-prefix is not so good for
Lua+expat...

<quote src="http://www.linuxworld.com/site-stories/2001/1128.lxp.html";>
LXP (also known as mod_lxp) is an application server that runs as an Apache
DSO (Dynamic Shared Object) module. It is designed to allow for the
simplified development of data-driven, dynamic Web sites involving support
for XML, and SQL (through PostgreSQL).
</quote>
<seealso src="http://www.commandprompt.com/products_lxp.lxp"; />

cheers, Martin

----- Original Message -----
From: "Jay Carlson" <[hidden email]>
To: "Multiple recipients of list" <[hidden email]>
Sent: Monday, November 26, 2001 6:05 AM
Subject: expat XML parser binding


> I've put a simple binding of expat, James Clark's C stream-based XML
parser
> up at http://www.place.org/~nop/lxp.tar.gz .  No, not everything is bound,
> but it should be obvious how to bind more stuff to it.
>
> BTW, list rep of <methodCall kind="xuxu"> as {xml="methodCall",
kind="xuxu"}
> requires great care in the presence of tinsert/tremove, or you won't be
able
> to have attributes named "n".  I'm leaning towards {"methodCall";
> attr={kind="xuxu}}, with contained elements from postion 2 onwards.  Of
> course, lxp doesn't have any opinion, because it just does
> starttag/endtag....
>
> Jay
>
>