strange xml_transformer_namespace_image behaviour
| From: | Stefan Textor | Date: | Sun, 04 May 2003 22:57:14 +0000 |
| Subject: | strange xml_transformer_namespace_image behaviour | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5222@lists.php.net to get a copy of this message | ||
hi folks,
i've tried a little around with xml_transformer_namespace_image.
under winxp i've got some strange results.
First I've tried the exapmle in the file:
------schnipp-----------
<?php
require_once 'XML/Transformer/Driver/OutputBuffer.php';
require_once 'XML/Transformer/Namespace/Image.php';
$t = new XML_Transformer_Driver_OutputBuffer;
$t->overloadNamespace('img', new XML_Transformer_Namespace_Image);
$t->setLogTarget('echo');
$t->setDebug(true);
$t->start();
//<img:img src="../../images/dsi-logo.jpg" alt="A sample image" />
?>
<img:gtextdefault bgcolor="888888" fgcolor="#000000"
font="arial.ttf" fontsize="33"
border="2" spacing="2"
split="" cacheable="yes" />
<img:gtext>0123456789 äöüßÄÖÜ</img:gtext>
---------schnapp---------
and all i get is a blank screen.
after this I tried to to put the xml in an exertnal file:
----------schnipp--------------
$t = new XML_Transformer;
$t->overloadNamespace('img', new XML_Transformer_Namespace_Image);
$t->setLogTarget('echo');
$t->setDebug(true);
$xmlfile= 'F:/www/test/pear_debug/img.xml';
$fh=fopen($xmlfile,'r');
$xml=fread($fh,2048);
$t->transform($xml);
-----------schnapp-------------
and get also a strange behaviour. error was junk after document element [...bla...]. it seemed that the 2. tag was not recognized as tag, the "junk" in the error was the cdata of 2. tag.
ok. in the 3. try i've merged the 2 tags (attributes to img:gtext) and
the first time an image appears in cache :-)
but awfully a blank one (or white text on white ground. can't be sure, but different textes resulted in different image sizes). i figured out, that the image is all the time blank, you set split="". with split="word" i got an image with visible text, but kind of malformed (sample attached). I think the textpositioning is not like intended.
does anyone have experiences with this under linux?
or just a clue for me?
it would also be fine, if multilinetext is respected as it should be (multilined).
oh, btw I use php 4.3.0 on apache 1.x with xml_transformer 0.8
--
Stefan Textor