Re: Strange character conversion when converting XML by XSLT in PHP

From: Date: Thu, 02 Dec 2004 22:48:25 +0000
Subject: Re: Strange character conversion when converting XML by XSLT in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-203395@lists.php.net to get a copy of this message
Age Bosma wrote:
I'm converting, or at least trying, one XML file to another XML format using XSLT parsing it with PHP. I'm using a lot of characters in the following style "& #34;", "& #42;", etc. (without the space, added now the prevent any conversion in this e-mail) in the XML file and I would like to keep it that way. PHP is converting every string like these to e.g. "&qout;" or "*". What can be done to prevent this conversion? As far as I understand this is default behaviour of the parser and can not be prevented. Personally I consider this a bug because what if I just want to use "& #34;" (without the space) as a normal string value? The parser shouldn't touch it at all. Can someone enlighten me a bit more on this one? :-)
If you want a literal " in your data, then you should have ", iirc. Maybe you could run the data through a preparser to match "&#xx;" patterns and convert the & to & ?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#203395) next »