Re: (no subject)

"Richard A. O'Keefe" <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 7/07/2013, at 8:32 AM, Josef Frydl wrote:

> I per may message:
> Hi, I am writing the small system in swi-prolog, which would search google and then bring down   individual sites and hrefs. which are in the query result.  Before I reinvent the wheel, let me ask you if there is already the utility which would would pick only 
> this    www.swi-prolog.org  from this  <cite>www.swi-<b>prolog</b>.org/</cite>
> 
> I decided to write DCG to do just that, which is simple, first it is very simplistic, since it is just first cut but got this error from  phrase_from_file

The important thing here is NOT to write your own stuff for parsing HTML
but to use the SGML support provided in SWI Prolog -- the sgml package.

Note that
1. <cite>www.swi-<b>prolog</b>.org/</cite>
2. <cite
   >www.swi-<!--
   --><b>prolog</b
   >.<!--
   -->org/</cite
   >
3. <cite><![CDATA[www.swi-]]><b><![CDATA[prolog]]></b><![CDATA[[.org/]]></cite>

are all legal, and in SGML, indistinguishable, ways to express the same
thing.  (Yes, I know that there are comment and CDATA objects in the XML
DOM.  I said *SGML*, where such things do *not* officially exist.)  Even
in XML,

4. <cite
   >www.swi-<b
   >prolog</b
   >.org/</cite
   >
is *identical* to 1.  And of course, let's never forget

5. <cite>www&#46;swi&#45;<b>prolog</b>&#46;org&#47;</cite>

which is also identical to 1 in XML and SGML.
(Claims verified by pushing all examples through an XML parser than
can be told to ignore comments and treat CDATA as plain data.)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.