Error with DOMDocument in php's functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guys,

I want to ask you about this problem:

I have a FUNCTION where is a DOMDocument element, that DOMDocument element
is "Load" from a string (With well formed XML structure) stored in a param,
this is code:

<?php

function xml_match($columns,$text,&$result)
{
...
/* Some code */
...
 $doc = new DOMDocument();
 $doc->loadXML($text);

... /* REST of function's code */

Now in the line number 63 (in the function) I have this code:

...
Line 62: $arrDocChilds = $doc->childNodes;
Line 63: if ($arrDocChilds->item($i)->nodeType != '3')
...

I have that function in one .php file (the function is the unique code in
that file, and the file name is xml_match.php); Now, the problem is, when I
try to execute that file from command line, I'm getting this error:

[admin@server xml]$ php xml_match.php
PHP Parse error:  parse error in
/var/www/vhosts/default/htdocs/spytest/share/xml/xml_match.php on line 63
Content-type: text/html
X-Powered-By: PHP/4.3.2

My question is, why is php launching this error, if the code is in a
function that is not called?

Regards

Mauricio M.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux