Re: Problems with XML_Transformer
| From: | Bruno Pedro | Date: | Fri, 07 Mar 2003 10:39:43 +0000 |
| Subject: | Re: Problems with XML_Transformer | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14131@lists.php.net to get a copy of this message | ||
On Fri, 2003-03-07 at 08:24, tobias@schlitt.info wrote:
> The problem comes up with the "&" and "?" inside the generated URI. The
> tag
> returned by the end_linlk() function will be parsed by XML_Transformer again
> (even if there is no method to call for it) and the XML parser gives an error
> for "not wellformed token".
Make sure you substitute the '&' character for its entity: '&'.
Another solution is to turn recursion off, in your transformer.
> Another point again are XML tags containing PHP code. This code-snippets
> should be handled as CDATA and not get transformed. I did not find a way to
> transport the "<?php" and "?>" tags to XHTML.
Try typing the PHP code as a CDATA section:
<?xml version="1.0">
<php>
<![CDATA[
<?php
echo 1+2;
?>
]]>
</php>
Make sure that you return the $cdata inside a CDATA section, and also
inside some tag, if you plan to transform this code snippets.
function end_php($cdata)
{
return '<dummy><![CDATA[' . $cdata . ']]></dummy>';
}
You only have to this if your transformer is recursive. If not, simply
return'ing $cdata is enough.
I hope it helps.
Regards
--
Bruno Pedro
PTM.com
Get my public key here:
http://search.keyserver.net:11371/pks/lookup?op=get&search=0x9FEECDC8
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc