Login   Register  
PHP Classes
elePHPant
Icontem

found a bug when a tag is empty

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      XML 2 PHP and PHP 2 XML  >  All threads  >  found a bug when a tag is empty  >  (Un) Subscribe thread alerts  
Subject:found a bug when a tag is empty
Summary:occured when convert xml to array and directly this array to xml
Messages:1
Author:Grahack
Date:2008-05-17 13:51:07
 

  1. found a bug when a tag is empty   Reply  
Picture of Grahack
Grahack
2008-05-17 13:51:08
In class_xmlparser.php, I needed to add the "else if"


if (!empty($xml_value['value'])) {
$xml .= sprintf("%s</%s>\n", $xml_value['value'], strtolower($xml_value['tag']));
} else if ($xml_value['type'] == "complete") {
$xml .= "</".strtolower($xml_value['tag']).">\n";
}

for your class to render "<description></description>" correctly after converting xml to array and directly this array to xml.

Thanks.