xslt question: building the Erlang FAQ

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xslt question: building the Erlang FAQ

Matthias Lang-2
Hi,

Something, I suspect xsltproc, is eating the non-ASCII characters in
the Erlang FAQ. I'm hoping someone here can give me a clue what it is.

The Erlang FAQ is generated using the same tools as the rest of the
Erlang documentation. But the transformation on erlang.org drops
letters, whereas the same transformation on my PC works fine:

           Source:  <em>Erlang Programmation</em> (Micka&euml;l R&eacute;mond)
    On erlang.org:  <strong>Erlang Programmation</strong> (Mickal Rmond)
  Output on my PC:  <strong>Erlang Programmation</strong> (Micka?l R?mond)

Can someone give me a clue as to what's going on?
Can anyone reproduce the bad version? I can't.
I have a workaround, but I'd prefer to know why it's going wrong.


More information
----------------

The Erlang FAQ source is on github:

   https://github.com/matthiasl/Erlang-FAQ

just type 'make' to build it on *nix machines, assuming you have
xsltproc installed. Here's what it looks like on my machine:

   Erlang-FAQ >make
   erl_docgen_privdir=`escript erl_docgen_privdir.escript`; \
           date=`date +"%B %e %Y"`; \
           xsltproc --stringparam outdir obj --stringparam gendate "$date" --stringparam topdocdir . --xinclude -path $erl_docgen_privdir/docbuilder_dtd -path $erl_docgen_privdir/dtd_html_entities faq_html.xsl faq.xml
   ...
   Erlang-FAQ >grep Mick *.xml obj/*
   obtaining.xml:  French: <em>Erlang Programmation</em> (Micka&euml;l R&eacute;mond)
   obj/obtaining.html:     French: <strong>Erlang Programmation</strong> (Micka?l R?mond)
   Erlang-FAQ >wget -q -O - http://www.erlang.org/faq/obtaining.html | grep Mick
        French: <strong>Erlang Programmation</strong> (Mickal Rmond)

The version information I have for the 'erlang.org' machine which is
generating the input I don't want:

   $ xsltproc --version
   Using libxml 20623, libxslt 10115 and libexslt 812
   xsltproc was compiled against libxml 20623, libxslt 10115 and libexslt 812
   libxslt 10115 was compiled against libxml 20623
   libexslt 812 was compiled against libxml 20623

   $ escript erl_docgen_privdir.escript
    /usr/local/otp/releases/sles10_64_R16A/lib/erl_docgen-0.3.4/priv

I've built exactly the same version of xlstproc, with exactly the same
libraries on my PC, but I don't get the dropped letters in the output.
Raimo is fairly sure that it's not the webserver's fault. So maybe
xsltproc is behaving differently on that machine for some reason. But
why?

One workaround i have is to write &#233; instead of &eacute;. That
solves the problem, but it's ugly. Might be a clue, though. I haven't
tried seeing what happens if I just type ??? etc. in the XML source;
I'd prefer to keep the FAQ source plain ASCII.

A brutal workaround would be just to rename people. Mickael Remond,
Clas Wikstrom and Bjorn. ;-)

Matt

Reply | Threaded
Open this post in threaded view
|

xslt question: building the Erlang FAQ

Bohuslav Svancara-2
Hi,
make sure that DTD files are accessible.

Bohuslav

2013/5/8 Matthias Lang <matthias>

> Hi,
>
> Something, I suspect xsltproc, is eating the non-ASCII characters in
> the Erlang FAQ. I'm hoping someone here can give me a clue what it is.
>
> The Erlang FAQ is generated using the same tools as the rest of the
> Erlang documentation. But the transformation on erlang.org drops
> letters, whereas the same transformation on my PC works fine:
>
>            Source:  <em>Erlang Programmation</em> (Micka&euml;l
> R&eacute;mond)
>     On erlang.org:  <strong>Erlang Programmation</strong> (Mickal Rmond)
>   Output on my PC:  <strong>Erlang Programmation</strong> (Micka?l R?mond)
>
> Can someone give me a clue as to what's going on?
> Can anyone reproduce the bad version? I can't.
> I have a workaround, but I'd prefer to know why it's going wrong.
>
>
> More information
> ----------------
>
> The Erlang FAQ source is on github:
>
>    https://github.com/matthiasl/Erlang-FAQ
>
> just type 'make' to build it on *nix machines, assuming you have
> xsltproc installed. Here's what it looks like on my machine:
>
>    Erlang-FAQ >make
>    erl_docgen_privdir=`escript erl_docgen_privdir.escript`; \
>            date=`date +"%B %e %Y"`; \
>            xsltproc --stringparam outdir obj --stringparam gendate "$date"
> --stringparam topdocdir . --xinclude -path
> $erl_docgen_privdir/docbuilder_dtd -path
> $erl_docgen_privdir/dtd_html_entities faq_html.xsl faq.xml
>    ...
>    Erlang-FAQ >grep Mick *.xml obj/*
>    obtaining.xml:  French: <em>Erlang Programmation</em> (Micka&euml;l
> R&eacute;mond)
>    obj/obtaining.html:     French: <strong>Erlang Programmation</strong>
> (Micka?l R?mond)
>    Erlang-FAQ >wget -q -O - http://www.erlang.org/faq/obtaining.html |
> grep Mick
>         French: <strong>Erlang Programmation</strong> (Mickal Rmond)
>
> The version information I have for the 'erlang.org' machine which is
> generating the input I don't want:
>
>    $ xsltproc --version
>    Using libxml 20623, libxslt 10115 and libexslt 812
>    xsltproc was compiled against libxml 20623, libxslt 10115 and libexslt
> 812
>    libxslt 10115 was compiled against libxml 20623
>    libexslt 812 was compiled against libxml 20623
>
>    $ escript erl_docgen_privdir.escript
>     /usr/local/otp/releases/sles10_64_R16A/lib/erl_docgen-0.3.4/priv
>
> I've built exactly the same version of xlstproc, with exactly the same
> libraries on my PC, but I don't get the dropped letters in the output.
> Raimo is fairly sure that it's not the webserver's fault. So maybe
> xsltproc is behaving differently on that machine for some reason. But
> why?
>
> One workaround i have is to write &#233; instead of &eacute;. That
> solves the problem, but it's ugly. Might be a clue, though. I haven't
> tried seeing what happens if I just type ??? etc. in the XML source;
> I'd prefer to keep the FAQ source plain ASCII.
>
> A brutal workaround would be just to rename people. Mickael Remond,
> Clas Wikstrom and Bjorn. ;-)
>
> Matt
> _______________________________________________
> erlang-questions mailing list
> erlang-questions
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130508/dbb49bfc/attachment.html>

Reply | Threaded
Open this post in threaded view
|

xslt question: building the Erlang FAQ

Matthias Lang-2
On Wednesday, May 08, Bohuslav Svancara wrote:

> make sure that DTD files are accessible.

Thanks! That was pretty much the problem.

The DTDs and .ent files are stored in different places for different
Erlang versions, which is why it works for me but not on erlang.org:

   R14B03: lib/erl_docgen/priv/docbuilder_dtd/
   R15B03: lib/erl_docgen/priv/dtd/

A bit surprising that xsltproc doesn't bomb out when it encounters
errors like that.

Thanks again,

Matt