Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 31872 - xsltproc can't find external entity "/dtd/guide.dtd" and produces spurious Âs
Summary: xsltproc can't find external entity "/dtd/guide.dtd" and produces spurious Âs
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-developer
Classification: Unclassified
Component: Guide XML (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-23 19:37 UTC by Jonathan Rogers
Modified: 2003-10-31 06:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to reference the docdev guide (xml-guide.diff,3.23 KB, patch)
2003-10-26 05:31 UTC, Sven Vermeulen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Rogers 2003-10-23 19:37:09 UTC
I followed the XML Guide as closely as possible, but I can't transform GuideXML
documents into HTML correctly. Either something in Gentoo has changed since the
guide was written or it failed to mention an important detail.

Reproducible: Always
Steps to Reproduce:
1.emerge libxslt
2.download "http://www.gentoo.org/dyn/arch/xml-guide-latest.tar.gz" and untar it
3.cd into the newly created "htdocs" directory
4.issue the command "xsltproc xsl/guide.xsl doc/en/gentoo-x86-install.xml >
/tmp/install.html"

Actual Results:  
The HTML output has many "
Comment 1 Jonathan Rogers 2003-10-23 19:37:09 UTC
I followed the XML Guide as closely as possible, but I can't transform GuideXML
documents into HTML correctly. Either something in Gentoo has changed since the
guide was written or it failed to mention an important detail.

Reproducible: Always
Steps to Reproduce:
1.emerge libxslt
2.download "http://www.gentoo.org/dyn/arch/xml-guide-latest.tar.gz" and untar it
3.cd into the newly created "htdocs" directory
4.issue the command "xsltproc xsl/guide.xsl doc/en/gentoo-x86-install.xml >
/tmp/install.html"

Actual Results:  
The HTML output has many "Â" (capital "A" with the circumflex diacritic mark)
characters at ends of section title lines, though this character appears nowhere
in the source GuideXML file.

In addition, xsltproc issues this warning on stderr:
------------------------------------------------------------------------
doc/en/gentoo-x86-install.xml:2: warning: failed to load external entity
"/dtd/guide.dtd"
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
                                        ^
------------------------------------------------------------------------


Expected Results:  
no warnings about missing DTDs and correct HTML output
Comment 2 SpanKY gentoo-dev 2003-10-23 22:11:00 UTC
the /dtd/guide.dtd is needed because that is the path on the Gentoo webserver
... further in the documentation are a bunch of notes about this ...
Comment 3 Jonathan Rogers 2003-10-23 23:40:44 UTC
What documentation mentions "/dtd/guide.dtd"? I can't find anything about
it in the "Gentoo Linux XML Guide" (http://www.gentoo.org/doc/en/xml-guide.xml).

The warning is only an annoyance, though I'd like to get rid of it. Where
can I learn how to point xsltproc to the DTD? I read the man page and tried
specifying catalog files, all to no avail.

What about the spurious characters? I've found a couple of bug reports about
the same characters in specific guides, but no indication of the root cause.
I seem to get them in every guide I transform.
Comment 4 SpanKY gentoo-dev 2003-10-24 00:36:00 UTC
the cheap way i do it w/out any hacking is this:
`ln -s /usr/local/gentoo/xml/htdocs/dtd /dtd`
that way /dtd/guide.dtd is a valid file ;)

gentoo is the cvs module found on the cvs server ...
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2003-10-24 00:57:36 UTC
These are both known issues, but cannot be fixed in the first degree, as
it is the difference between a live server (with /dtd/guide.dtd and a combination
of four xsl-files) and a locally created "repository".

Please check out http://www.gentoo.org/proj/en/gdp/doc/en/docdev.xml; it
gives an explanation how to set up a local repository which doesn't have
these problems (as it uses an altered guide.xsl version).

The xml-guide does need to be updated to reflect this though.
Comment 6 Xavier Neys (RETIRED) gentoo-dev 2003-10-24 02:18:48 UTC
Can't help with those spurious characters. I xsltproc our docs all the time
and never have seen this happen here.

About the missing DTD warning.
1) You can avoid the warning by not checking the DTD at all. xsltproc DOES
check that your xml file IS an xml file. Use the --novalid options.

2) If you do want to validate it without doing spanky's ugly hack, use the
--catalogs option (man xsltproc) like this:
You can either define the guide dtd in /etc/xml/catalog or use your own copy
of this file. I did not want to mess up my "official" /etc/xml/catalog so
I created a catalog.gentoo which looks like this:

<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
                         "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <system systemId="/dtd/guide.dtd" uri="/home/neysx/gentoo.org/gentoo/xml/htdocs/dtd/guide.dtd"/>
</catalog>

Adapt the uri to your system.
Use xsltproc like this

SGML_CATALOG_FILES="./catalog.gentoo" xsltproc --catalogs -o vi-guide.html
../../gentoo/xml/htdocs/xsl/guide.xsl vi-guide.xml

Or simply export the SGML_CATALOG_FILES env variable.
The actual xsltproc command line sits in a script here, I don't type it all
every time ;-)

Hth
Comment 7 Jonathan Rogers 2003-10-24 19:27:16 UTC
Thanks for all the great suggestions. I was aware that validation wasn't
strictly necessary, but I'll try the suggestions to provide a catalog to
allow xsltproc to resolve the external entity. The main mystery is the about
the generated 
Comment 8 Jonathan Rogers 2003-10-24 19:27:16 UTC
Thanks for all the great suggestions. I was aware that validation wasn't
strictly necessary, but I'll try the suggestions to provide a catalog to
allow xsltproc to resolve the external entity. The main mystery is the about
the generated Âs.
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2003-10-25 02:06:33 UTC
AFAIK, the 
Comment 10 Sven Vermeulen (RETIRED) gentoo-dev 2003-10-25 02:06:33 UTC
AFAIK, the Â's come from &#160;'s in the guide.xsl template. Those aren't
there in the guide.xsl made for local usage (http://emu.gentoo.org/~swift/local/guide.xsl).
I'll check when those were added in the official stylesheets and why.
Comment 11 Jonathan Rogers 2003-10-25 12:42:09 UTC
I used http://emu.gentoo.org/~swift/local/guide.xsl and everything looks
good now.
Comment 12 Sven Vermeulen (RETIRED) gentoo-dev 2003-10-26 05:30:42 UTC
Since we have a docdev guide, perhaps it is wise to reference to it from
the xml-guide, and remove all the blabla from the current guide. The docdev
guide contains all information on testing xml-guides (including tarball usage
etc.)

I'll put up a patch that does this.
Comment 13 Sven Vermeulen (RETIRED) gentoo-dev 2003-10-26 05:31:22 UTC
Created attachment 19814 [details, diff]
Patch to reference the docdev guide

This should do it. If a docdev can review?
Comment 14 Lars Weiler (RETIRED) gentoo-dev 2003-10-26 09:21:50 UTC
One word to the missing guide.xsl during xsltproc:

Update the doctype-line in the document so that it reads
<!DOCTYPE guide SYSTEM "http://www.gentoo.org/dtd/guide.dtd">

xsltproc will fetch the guide.dtd from the website instead of somewhere in
the local filesystem.
Comment 15 Benny Chuang (RETIRED) gentoo-dev 2003-10-30 18:56:34 UTC
patch reviewed
Comment 16 Sven Vermeulen (RETIRED) gentoo-dev 2003-10-31 06:49:02 UTC
Committed.