On Friday 09 December 2005 14:14, Christophe Costa Florencio wrote:
> Hi,
>
> I have some problems with document rendering in PCE. I used the code from
> the PCE manual, subsection "11.10.4 Using the ``doc/emit'' library", and
> the sample html file provided there.
>
> I use XPCE 6.4.3 with SWI-Prolog version 5.4.7 on WinXP SP2.
>
> Issuing the command "show_html('sample.html')." does not have the desired
> effect. SWI issues the error messages:
>
> ERROR: SGML2PL(sgml): sample.html:23: Syntax error: Bad attribute list,
> found "/
> ListOfNameValue/ re ... nd <b"
> Warning: SGML2PL(sgml): sample.html:25: Ignored end-tag for "b" which is
> not open
> Warning: SGML2PL(sgml): sample.html:26: Inserted omitted end-tag for "var"
>
> Worse is the fact that text may be rendered over other text, as the
> picture
> http://www.cs.rhul.ac.uk/home/chris/docrender.gif
> demonstrates. This seems to happen especially when enlarging the window or
> making it smaller.
>
> Also, the html code:
>
> Where <var/ListOfNameValue/ reflects the attribute-list of the
> element and <var/ListOfContent/ is mixed list of atoms representing
> <em/CDATA/ and <b>element/3</b> terms representing nested elements.
>
> is rendered as if it were
>
> Where <b>element/3</b> terms representing nested elements.
load_html_file/2 is defined as:
load_html_file(File, Term) :-
dtd(html, DTD),
load_structure(File, Term,
[ dtd(DTD),
dialect(sgml),
shorttag(false)
]).
As you see, it does not allow for the <short/tag/ notation. I don't know
whether or not this is correct, but switching it off made it behave
better on the html files you tend to find in the wild. If you have
documents with shorttag, simply write your own load_html_file/2.
Both dtd/2 and load_structure/3 are public predicates of the library,
so this is pretty easy.
There are indeed sometimes problems in the rendering. I'm not saying
this is good, but it is not very likely to be fixed (by me) anytime
soon. Too busy ...
Cheers --- Jan
|