|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-12-28 07:17 UTC] l dot chemwolo at heinosoft dot eu
Description:
------------
When I parse an xml file containing <builder>Bill & Joseph Cook</builder> I get Joseph Cook as the value between these tags. It drops anything that comes before &.
I am using php 5.1.2. I could see this on the section "PHP version" above so I just picked one of the listed.
Reproduce code:
---------------
I am using a class:
class CluistraParser extends XML_Parser{
...
}
to do the parsing based on the parser.php file.
Expected result:
----------------
To get 'Bill & Joseph Cook' as the value for the tag <builder>.
Actual result:
--------------
I get 'Joseph Cook'. Anything before & is dropped and the ampersand does not appear.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 20:00:01 2025 UTC |
Reproduce code: --------------- <?php require_once 'Parser.php'; class CluistraParser extends XML_Parser{ function cdataHandler($parser, $data) { $data=trim($data); echo $data."<br/>"; } } $cluistra=new CluistraParser(); $cluistra->setInputFile("afile.xml"); $success = $cluistra->parse(); if (PEAR::isError($success)) { die('Parsing failed: '.$success->getMessage()); } /*afile.xml has: <?xml version='1.0' encoding='ISO-8859-1'?> <builder>Bill & John Keen</builder>*/ ?>