note 88691 added to function.xml-parse

From: Date: Tue, 03 Feb 2009 21:30:13 +0000
Subject: note 88691 added to function.xml-parse
Groups: php.notes 
Request: Send a blank email to php-notes+get-150172@lists.php.net to get a copy of this message
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); } } } ---- Server IP: 216.235.13.26 Probable Submitter: 72.140.230.39 ---- Manual Page -- http://www.php.net/manual/en/function.xml-parse.php Edit -- https://master.php.net/note/edit/88691 Del: integrated -- https://master.php.net/note/delete/88691/integrated Del: useless -- https://master.php.net/note/delete/88691/useless Del: bad code -- https://master.php.net/note/delete/88691/bad+code Del: spam -- https://master.php.net/note/delete/88691/spam Del: non-english -- https://master.php.net/note/delete/88691/non-english Del: in docs -- https://master.php.net/note/delete/88691/in+docs Del: other reasons-- https://master.php.net/note/delete/88691 Reject -- https://master.php.net/note/reject/88691 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#150172) next »