note 76589 modified in function.xsl-xsltprocessor-import-stylesheet by danbrown

From: Date: Fri, 28 Nov 2008 22:12:17 +0000
Subject: note 76589 modified in function.xsl-xsltprocessor-import-stylesheet by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147312@lists.php.net to get a copy of this message
PHP5 xsl processor has a different behaviour than PHP4's one with CDATA sections. (see http://bugs.php.net/bug.php?id=29837) Loaded XSL sheet CDATA sections does not allow, by default, output-escaping handling (everything in the CDATA is escaped by default). So in this case you can't build your XSL Dom the usual way: $xsldom = DomDocument::loadXML(file_get_contents('sheet.xsl')); and must go through this one (allowing LIBXML_NOCDATA parameter): $xsldom = new DomDocument; $xsldom->load('sheet.xsl', LIBXML_NOCDATA); Then the CDATA output-escaping behaviour will be correct. --was-- PHP5 xsl processor has a different behaviour than PHP4's one with CDATA sections. (see http://bugs.php.net/bug.php?id=29837) Loaded XSL sheet CDATA sections does not allow, by default, output-escaping handling (everything in the CDATA is escaped by default). So in this case you can't build your XSL Dom the usual way: $xsldom = DomDocument::loadXML(file_get_contents('sheet.xsl')); and must go through this one (allowing LIBXML_NOCDATA parameter): $xsldom = new DomDocument; $xsldom->load('sheet.xsl', LIBXML_NOCDATA); Then the CDATA output-escaping behaviour will be correct. http://php.net/manual/en/function.xsl-xsltprocessor-import-stylesheet.php

« previous php.notes (#147312) next »