#28826 [Opn->Bgs]: SimpleXML expands entities but DOM + XSL does not

2004-06-21 Thread joe at joerags dot com
 ID:   28826
 User updated by:  joe at joerags dot com
 Reported By:  joe at joerags dot com
-Status:   Open
+Status:   Bogus
 Bug Type: XSLT related
 Operating System: Mac OS 10.2.8
 PHP Version:  5CVS-2004-06-18 (dev)
 New Comment:

I did the following and the test script I submitted 
works.

Using Fink (http://fink.sourceforge.net), I had it 
build and install libxml2 2.5.10 and libxslt 1.0.32. I 
then recompiled PHP 5 RC3 with these configuration 
commands: ./configure --prefix=/usr/local --with-zlib 
--with-libxml-dir=/sw --with-xsl=/sw --with-apxs=/usr/
sbin/apxs

The test script I submitted likely didn't work either 
because of user error on my part or a bug in something 
other than PHP.


Previous Comments:


[2004-06-18 11:09:05] joe at joerags dot com

Description:

When attempting to do an XSL transformation using the 
new DOM and XSL extensions available in PHP 5, I've 
noticed entities aren't expanded in the output. If I 
import the DOM object into SimpleXML, the entities are 
expanded.

The first time I attempted to run the following code I 
was using PHP 5 RC3, libxml2 2.6.10, and libxslt 1.1.7. 
I am now using CVS versions of PHP 5, libxml2, and 
libxslt in order to see if this was a bug fixed in 
either PHP 5, libxml2, or libxslt. The CVS versions I'm 
using were downloaded June 18th.

I run Apache 1.3.31 under Mac OS 10.2.8. I don't recall 
seeing any errors when I built and installed Apache, 
PHP, libxml2, or libxslt.

Reproduce code:
---


]>

  Example Document
  &entity1;
  &entity2;

EOD;

$xsl = <<http://www.w3.org/1999/XSL/Transform";>
  
XSL Element 1: 
XSL Element 2: 
XSL Element 3: 
  

EOD;

$xmlDocument = new DomDocument;
$xmlDocument->loadXML($xml);
$xslDocument = new DomDocument;
$xslDocument->loadXML($xsl);
$processor = new XsltProcessor;
$processor->importStyleSheet($xslDocument);
print $processor->transformToXML($xmlDocument);

$xmlDocument = simplexml_import_dom($xmlDocument);
print 'SimpleXML Element 1: ' . $xmlDocument->element1 . '';
print 'SimpleXML Element 2: ' . $xmlDocument->element2 . '';
print 'SimpleXML Element 3: ' . $xmlDocument->element3 . '';
?>

Expected result:

XSL Element 1: Example Document

XSL Element 2: Entity 1

XSL Element 3: Entity 2

SimpleXML Element 1: Example Document

SimpleXML Element 2: Entity 1

SimpleXML Element 3: Entity 2

Actual result:
--
XSL Element 1: Example Document

XSL Element 2: 

XSL Element 3: 

SimpleXML Element 1: Example Document

SimpleXML Element 2: Entity 1

SimpleXML Element 3: Entity 2





-- 
Edit this bug report at http://bugs.php.net/?id=28826&edit=1


#28826 [NEW]: SimpleXML expands entities but DOM + XSL does not

2004-06-18 Thread joe at joerags dot com
From: joe at joerags dot com
Operating system: Mac OS 10.2.8
PHP version:  5CVS-2004-06-18 (dev)
PHP Bug Type: XSLT related
Bug description:  SimpleXML expands entities but DOM + XSL does not

Description:

When attempting to do an XSL transformation using the 
new DOM and XSL extensions available in PHP 5, I've 
noticed entities aren't expanded in the output. If I 
import the DOM object into SimpleXML, the entities are 
expanded.

The first time I attempted to run the following code I 
was using PHP 5 RC3, libxml2 2.6.10, and libxslt 1.1.7. 
I am now using CVS versions of PHP 5, libxml2, and 
libxslt in order to see if this was a bug fixed in 
either PHP 5, libxml2, or libxslt. The CVS versions I'm 
using were downloaded June 18th.

I run Apache 1.3.31 under Mac OS 10.2.8. I don't recall 
seeing any errors when I built and installed Apache, 
PHP, libxml2, or libxslt.

Reproduce code:
---


]>

  Example Document
  &entity1;
  &entity2;

EOD;

$xsl = <<http://www.w3.org/1999/XSL/Transform";>
  
XSL Element 1: 
XSL Element 2: 
XSL Element 3: 
  

EOD;

$xmlDocument = new DomDocument;
$xmlDocument->loadXML($xml);
$xslDocument = new DomDocument;
$xslDocument->loadXML($xsl);
$processor = new XsltProcessor;
$processor->importStyleSheet($xslDocument);
print $processor->transformToXML($xmlDocument);

$xmlDocument = simplexml_import_dom($xmlDocument);
print 'SimpleXML Element 1: ' . $xmlDocument->element1 . '';
print 'SimpleXML Element 2: ' . $xmlDocument->element2 . '';
print 'SimpleXML Element 3: ' . $xmlDocument->element3 . '';
?>

Expected result:

XSL Element 1: Example Document

XSL Element 2: Entity 1

XSL Element 3: Entity 2

SimpleXML Element 1: Example Document

SimpleXML Element 2: Entity 1

SimpleXML Element 3: Entity 2

Actual result:
--
XSL Element 1: Example Document

XSL Element 2: 

XSL Element 3: 

SimpleXML Element 1: Example Document

SimpleXML Element 2: Entity 1

SimpleXML Element 3: Entity 2

-- 
Edit bug report at http://bugs.php.net/?id=28826&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28826&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28826&r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=28826&r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=28826&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28826&r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=28826&r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=28826&r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=28826&r=support
Expected behavior:  http://bugs.php.net/fix.php?id=28826&r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=28826&r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=28826&r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=28826&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28826&r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=28826&r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=28826&r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=28826&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28826&r=float