Subject: Re: [SWIPL] XML Parser (SGML package)

From: Jan Wielemaker <[email-masked]>
Date: Wed, 31 Jan 2001 17:09:06 +0100

On Wed, 31 Jan 2001, Alberto Ruiz Cristina wrote:
><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
><html>
>Hello!
><p>I have succesfully tried the validating XML parser included in Sgml
>package. I use the "load_structure" predicate, and I get a list of content
>as a result.
><p>I have also tried the "sgml_parse" predicate, and I have read in the
>documentation that output can be set to a stream. But how can you specify
>output in that predicate?
><p>Thank you
><p>Alberto Ruiz Cristina
><br>Spain</html>

I don't have an HTML parser built-in, but reading between the tags I
think I know what you want ...

*output* cannot be set to a stream (it is a Prolog term), but *input*
can.  Just have a look at load_structure in that library and the
PDF documentation and you'll get the picture.  Basically it is
something along the lines:

	new_sgml_parser(Parser, Options),
	sgml_parse(Parser,
		   [ document(DOM), source(Stream), ... ])
	...

	Cheers --- Jan