Re: [xslt] disable-output-escaping disfunctional



On Mon, Apr 21, 2003 at 06:12:32PM +0200, Gabor Hojtsy wrote:
> The processor clearly uses the HTML output method (it outputs DOCTYPE 
> information at the top of the output files). I have tried to switch to 
> the XML output method with success, but without 'fixing the bug'. So the 
> output was in XML (eg. <a name="something"/> and <br/>), but 
> disable-output-escaping still didn't work. So the bug does not seem to 
> be connected to the HTML output method.
> 
> As disable-output-escaping is a local statement for the xslt processor, 
> it cannot be overriden by it's context. Therefore I still strongly 
> beleive that I have found a bug in xsltproc/libxml and not a bug in the 
> DocBook sheets.

  Have you read the following from the spec 16.4 Disabling Output Escaping:

"It is an error for output escaping to be disabled for a text node that
is used for something other than a text node in the result tree. Thus,
it is an error to disable output escaping for an xsl:value-of or xsl:text
element that is used to generate the string-value of a comment, processing
instruction or attribute node; it is also an error to convert a result
tree fragment to a number or a string if the result tree fragment
contains a text node for which escaping was disabled. In both cases,
an XSLT processor may signal the error; if it does not signal the error,
it must recover by ignoring the disable-output-escaping attribute."

  So basically if you use disable-output-escaping for something which
is not a text node immediately used as output then, it is normal for 
libxslt/xsltproc to ignore that statement completely. Like if you use
it to build a variable or a result value tree passed to a node-set() 
extension then this is guaranteed to be ignored rightfully.
  In general the rule is *do not use disable-output-escaping" !
It just prove you're trying to do something which is wrong from a
structure transformation point of view.

> I have prepared a 2MB testcase. It includes the DocBook XSL sheets HTML 
> part, and our customizations in question, and a PHP Manual Light 
> (<book/> :) ). In a tgz it is just 220Kb, so I can put it up somewhere 
> in case you are willing to test it, and find out why it is not working. 
> It is fully testable, with an XML file and an XSL sheet (at least it 
> works for me standing alone)...

  Please check first for what I just pointed out, if this is not the
case then yes put it online somewhere.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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