summaryrefslogtreecommitdiff
path: root/it_xml.class
diff options
context:
space:
mode:
authorUrban Müller2009-10-01 12:49:34 +0000
committerUrban Müller2009-10-01 12:49:34 +0000
commit5115c25bb852f8463b2d6584dc29024c7003e71c (patch)
tree60d9715d223673a2e1fd479a690e1720957579dc /it_xml.class
parent1faefabd44ac19968a1c16417e5197bb60b0dce5 (diff)
downloaditools-5115c25bb852f8463b2d6584dc29024c7003e71c.tar.gz
itools-5115c25bb852f8463b2d6584dc29024c7003e71c.tar.bz2
itools-5115c25bb852f8463b2d6584dc29024c7003e71c.zip
warn by default about bad xml
Diffstat (limited to 'it_xml.class')
-rw-r--r--it_xml.class12
1 files changed, 6 insertions, 6 deletions
diff --git a/it_xml.class b/it_xml.class
index 5dd4ead..fa67c4c 100644
--- a/it_xml.class
+++ b/it_xml.class
@@ -27,11 +27,11 @@ class it_xml
* Add xml snippet as attribute tree to $this
* @param $xmldata XML string or filehandle (result from fopen) to parse
* @param $p associative array
- * forcearray xml tags to ALWAYS return as array
- * safety value 2 causes program abort with invalid xml, 1 causes error report
- * encoding Output character encoding (e.g. UTF-8, default: ISO-8859-1)
- * prefix Optional prefix for class names
- * lowercase Lowercase all tag and attribute names
+ * @param $p['forcearray'] xml tags to ALWAYS return as array
+ * @param $p['safety'] 2 causes program abort with invalid xml, 1 (default) causes error report, 0 just returns false
+ * @param $p['encoding'] Output character encoding (e.g. UTF-8, default: ISO-8859-1)
+ * @param $p['prefix'] Optional prefix for class names
+ * @param $p['lowercase'] Lowercase all tag and attribute names
* @return XML object tree or null on failure
*/
@@ -55,7 +55,7 @@ function create($xmldata, $p = array())
function from_xml($xmldata, $p)
{
- $this->_p = $p + array('encoding' => "ISO-8859-1");
+ $this->_p = $p + array('encoding' => "ISO-8859-1", 'safety' => 1);
$this->_arrayforce = array_flip((array)$this->_p['forcearray']);
$this->_stack = array();
unset($this->error);