xhtml-1.0 transitional and xmerl?

Bertil Karlsson bertil@REDACTED
Tue Jan 18 12:50:37 CET 2005


Hi,

It is not true that external entities are not supported. In the Release 
Notes you can read that there is no support to fetch external entities 
that are referenced by a URL. By this I ment that it is no built-in 
support for that, but you can still provide your own fetch function that 
  manage this.

However, it is something that fails when using the xhtml DTDs. I have 
not yet got a clear picture about what has to be done to manage those 
DTDs. The first bug I run into was when parsing the comments in one of 
the referenced entites that enclosed an entity definition, ... but there 
were something more.

I hope to deliver a patched version in the march release of the open 
source OTP.

/Bertil

Joakim G. wrote:
> Hi,
> I tried to validate couple of xhtml-1.0 pages with xmerl. I downloaded
> the xhtml-1.0 transitional DTDs from:
> http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Transitional and
> tried to use them with xmerl:
> 
> ====
> 
> Erlang (BEAM) emulator version 5.4.3 [source] [hipe]
> 
> Eshell V5.4.3  (abort with ^G)
> 1> xmerl_scan:file("test.html", [{validation, true}, {fetch_fun, fun(U, 
> G) -> {ok, {file, "xhtml1-transitional.dtd"}, G} end}]).
> 2748- fatal: {invalid_name," HTMLl"}
> ** exited: {fatal,{{invalid_name," 
> HTMLl"},"xhtml1-transitional.dtd",29,700}} **
> ====
> 
> Hmm. Sifting through the xmerl release notes I realised that external
> entities isn't supported. Just for the heck of it I replaced the
> external entity references in the DTD with the actual content and
> tried again:
> 
> ====
> 
> Erlang (BEAM) emulator version 5.4.3 [source] [hipe]
> 
> Eshell V5.4.3  (abort with ^G)
> 1> xmerl_scan:file("test.html", [{validation, true}, {fetch_fun, fun(U, 
> G) -> {ok, {file, "xhtml1-transitional.dtd"}, G} end}]).
> 3319- fatal: unexpected_end
> ** exited: {fatal,{unexpected_end,"xhtml1-transitional.dtd",635,111}} **
> 2>
> 
> ====
> 
> It was doomed to fail I suppose.
> 
> My question: Has anyone else used xmerl in combination with the xhtml-1.0
> DTDs?
> 
> Cheers
> /Jocke
> 
> 




More information about the erlang-questions mailing list