xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Burrell Donkin <RobertDon...@appleonline.net>
Subject setting external DTD in xalan
Date Wed, 24 Jan 2001 21:14:20 GMT

Taylor, Kevin wrote

>I have been trying to get this to work for several days and cannot find
>example in any of the xalan docs.  I am using the java xalan 1.2D01.
>I am converting xml to xhtml and want to use the xhtml1-strict.dtd for
>xsl stylesheet.  I have attempted to include the following in my xsl:
><output method="xml" doctype-system="/xhtml1-strict.dtd"/>
>I have downloaded the xhtml1-strict.dtd to the root directory and have
>successfully used it in xml that is not xsl stylesheets.  For some
>when calling the processor.process( xmlSource, xslSheet, xmlResult );
>this dtd (or any dtd), the parser says that nbsp isn't defined
(although it
>is in the dtd.)
>So, xalan is not finding the dtd.  Is this something that has to be
>on the XSLTProcessor object or some other java object?

i nearly got this to work before christmas but came up with a few
annoying 'features' of xalan - like it's habit of helpfully listing
entities at the top of the xhtml document produced. i did subscribe to
the dev lists for a little while with a view to sorting out a fix but
it's much too high traffic for me.

1.  i don't have the machine with my xml-xhtml stuff on with me at the
moment, but you should start by downloading all the xhtml dtd and entity
documents from w3c. the problem you're having is that the
xhtml-1-strict.dtd uses separate DTDs to store it's entities. xalan
requires that all entities be specifically defined in the DTD (hence the
definition problem) so you'll need all the entity dtds as well. once you
got them all and fiddled with it, you should get to where i was which
was good xhtml but with a load of comments and entity descriptions at
the top. you'll then need to subscribe to the dev list and get some help
to fix the problem. it's not that the list is offensive, it's just very
busy - and this stuff a bit peripheral for me.

2. write a post-processor which takes standard html outputted from xalan
and wraps it nicely in xhtml - or use one that's already available (tidy
has a java port - look at w3c for links). this is the quickest way to
get the job done - but i still think that if you have the time, getting
xalan to produce nice xhtml would be worthwhile.

hope this helps

View raw message