[Ocaml-pxp-users] Parsing from string using custom resolvers....

Gerd Stolpmann info at gerd-stolpmann.de
Wed Mar 22 15:09:45 PST 2006


Am Mittwoch, den 22.03.2006, 02:54 +0100 schrieb Till Varoquaux:
> Hi there,
> I'm trying to parse a document from a string. I have a set of custom
> resolvers that I want to use (and they work fine when parsing form a
> file).
> 
> The function Pxp_yacc.from_channel seems to have everything I'm
> looking for (id and alt) but I cannot (AFAIK) easily convert from a
> string to an in_channel. I tried working my way aroun XExtID but I'm
> most probably calling it wrong. Any idea on how I should tackle this
> problem?

Use Pxp_yacc.from_obj_channel. It provides the same interface as
from_channel, but takes a generalized type of channel as input.

Pass

new Netchannels.input_string s

as input channel to this function (when s is the string to parse).

Gerd

> 
> Cheers,
> Till
> 
> _______________________________________________
> Ocaml-pxp-users mailing list
> Ocaml-pxp-users at orcaware.com
> http://www.orcaware.com/mailman/listinfo/ocaml-pxp-users
> 
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd at gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------




More information about the Ocaml-pxp-users mailing list