PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_Transformer » Bug #2595

No output if class XML_Transformer_Namespace_Image is involved

Details

Submitted2004-10-22 21:13 UTC
Fromcsg at diatom dot de
StatusBogus
PackageXML_Transformer
PHP Version4.3.8
OSLinux 2.4.27
Roadmaps(Not assigned)

Comments

[2004-10-22 21:13 UTC] csg at diatom dot de

Description:
------------
I had downloaded today XML_Transformer-1.0.1.tgz and have
played with it - but no example did produce any output if
class XML_Transformer_Namespace_Image was involved.

Neither code published in iX (http://www.heise.de/ix/
artikel/2003/12/124/ especially Listings 2 and 4) nor the
example code in file Transformer/Namespace.php.
(In the latter case I could fix the problem while replacing
XML_Transformer::attributesToString($this->imageAttributes)
with
XML_Util::attributesToString($this->imageAttributes)
)

Note:
Caused by "Safe mode" restrictions I had to install the
PEAR packages XML_Transformer-1.0.1.tgz and
XML_Util-0.6.1.tgz manually as described in the PEAR
manual.

Output of phpinfo() is available at http://www.diatom.de/
test.php .

Reproduce code:
---------------
One of several examples with the problem above is listet here:
<?php
error_reporting(E_ALL);
ini_set( 'include_path', '/var/httpd/web1/pearIncludes/' . PATH_SEPARATOR . ini_get('include_path') );

require_once 'XML/Transformer.php';
require_once 'XML/Transformer/Namespace/Image.php';

$t = new XML_Transformer(
array(
'debug' => true,
'overloadedNamespaces' => array(
'img' => new XML_Transformer_Namespace_Image
)
)
);
$t->transform('<img:img src="test.png" />');
?>

Expected result:
----------------
Image with width and height attributes, e,g,:

<img src="test.png" width="256" height="256" />

Actual result:
--------------
really nothing - empty result page (even in source view).

[2004-11-03 12:46 UTC] csg at diatom dot de

The code example is not quite right - it does miss an
"echo $t" instruction at the end. (I'm sorry for that -
the example was originally based on an "OutputBuffer" one
and there is no need for the echo instruction.)
Inserting this missed instruction behaviour does change:
Now entire output consists of word "Object":
http://www.diatom.de/testXmlTransformerImage.php

However, expected output would be an extended image tag,
too, e.g. <img ...

(Note: Beside of using XML_Transformer_Namespace_Image,
over time XML_Transformer does a good job for me. Thanks
for writing it!)