Permalink
Browse files

Fix for bug 1822 (http://pear.php.net/bugs/bug.php?id=1822)

git-svn-id: http://svn.php.net/repository/pear/packages/XML_Tree/trunk@163143 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
dshafik committed Jul 12, 2004
1 parent 32b3b79 commit eb64548c341ada723a299315972077f23d3dc671
Showing with 6 additions and 4 deletions.
  1. +6 −4 Tree.php
View
@@ -226,13 +226,14 @@ function &removeChild($path, $pos)
/**
* Maps a XML file to a XML_Tree
*
+ * @param string $encoding XML Files encoding, use NULL (default) to use whatever the document specifies
* @return mixed The XML tree root (an XML_Tree_Node), or PEAR_Error upon error.
* @access public
*/
- function &getTreeFromFile ()
+ function &getTreeFromFile ($encoding = null)
{
$this->folding = false;
- $this->XML_Parser(null, 'event');
+ $this->XML_Parser($encoding, 'event');
$err = $this->setInputFile($this->filename);
if (PEAR::isError($err)) {
return $err;
@@ -248,14 +249,15 @@ function &getTreeFromFile ()
/**
* Maps an XML string to an XML_Tree.
*
+ * @param string $encoding XML Files encoding, use NULL (default) to use whatever the document specifies
* @return mixed The XML tree root (an XML_Tree_Node), or PEAR_Error upon error.
* @access public
*/
- function &getTreeFromString($str)
+ function &getTreeFromString($str, $encoding = null)
{
$this->i = null;
$this->folding = false;
- $this->XML_Parser(null, 'event');
+ $this->XML_Parser($encoding, 'event');
$this->cdata = null;
$err = $this->parseString($str);
if (PEAR::isError($err)) {

0 comments on commit eb64548

Please sign in to comment.