note 88691 deleted from function.xml-parse by danbrown
| From: | danbrown@php.net | Date: | Tue, 03 Feb 2009 21:32:57 +0000 |
| Subject: | note 88691 deleted from function.xml-parse by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-150173@lists.php.net to get a copy of this message | ||
Note Submitter: anonymous@anonymous
----
Hey, I really like the class that james at mercstudio wrote (u007XML).
It seems to be very stable / simple so far, aside from one thing, it's not catching zero values
as the number "0" here's what I changed:
- in the function tagData():
<< if(trim($tagData)) {
for
>> if(strlen(trim($tagData))>0) {
Here's my full function:
function tagData($parser, $tagData) {
if(strlen(trim($tagData))>0) {
if(isset($this->arrOutput[count($this->arrOutput)-1]['nodeValue'])) {
$this->arrOutput[count($this->arrOutput)-1]['nodeValue'] .=
$this->parseXMLValue($tagData);
}
else {
$this->arrOutput[count($this->arrOutput)-1]['nodeValue'] =
$this->parseXMLValue($tagData);
}
}
}