2003-12-02 kl. 22.08 skrev Manuel Lemos:


The code
// Prepare the content of the xml-file to go to the xsl-parser
$xml = str_replace("<empty/>", $tempxml, $xml);
$xml = trim($xml);
$xml = utf8_encode($xml);
echo $xml;
makes the string
"<?xml version="1.0" encoding="utf-8"?>"
become
"<?xml version="1.0" encoding="utf-8"?>"
And the crap in fron of the string, which seems to come from nowhere, makes the parser complain about not well formed markup in the xml-source…

I think it does not make any sense to do what you are doing. You should only encode XML data or attribute values. You should not encode the whole XML document.

Well, I have some xml in which I want to place som new xml-data, just for the specific output, which I does by replacing an empty dummy-tag.


After this, I want to send the xml to the parser.

Anyway, if you try this class, you can see that it generates correct XML code in UTF or even ISO-8859-1.

Well, but I don't want to download and evaluate classes, especially since they tend to be big and I just want to be able to do this with the few lines of code that should be enought…


Should it really be this troublesome working with XML from PHP?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to