lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Are XSL stylesheet DTDs imported?


From: Vadim Zeitlin
Subject: Re: [lmi] Are XSL stylesheet DTDs imported?
Date: Fri, 30 Oct 2015 01:29:46 +0100

On Thu, 29 Oct 2015 23:22:31 +0000 Greg Chicares <address@hidden> wrote:

GC> Given that 'fo_common.xsl' declares an 'nbsp' entity, do other XSL files
GC> that include it need to declare that entity in order to use it? See
GC> 'illustration_reg.xsl' as just one of several examples:
GC> 
GC> <!DOCTYPE stylesheet [
GC> <!ENTITY nbsp "&#xA0;">
GC> ]>
GC> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:fo="http://www.w3.org/1999/XSL/Format"; version="1.0">
GC>   <xsl:import href="fo_common.xsl"/>

 I suspected that Betteridge's law of headlines applied, but I wasn't sure,
so I tested it and now I can confirm that it definitely does: removing the
local DTD from illustration_reg.xsl and trying to use it with xsltproc
results in

illustration_reg.xsl:212: parser error : Entity 'nbsp' not defined
              <xsl:value-of select="$scalars/AvName"/>&nbsp;
                                                            ^
followed by several dozens more of similar errors.

 If you're interested in more than just the answer, my understanding is
that xsl:import can't do anything affecting the parsing of the XML document
which an XSLT stylesheet is, in the first place. As nbsp entity is not
defined in XML, unlike HTML, it has to be defined in the DTD. Of course,
xsl:import has a special value for the XSLT processor, but this happens
only after the stylesheet is successfully parsed as an XML document.

 Regards,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]