PhpXpath 3.3
Brought to you by:
bs_php,
nigelswinson
From: Dan <xp...@da...> - 2003-04-08 17:59:34
|
First of all, sorry about my last post (php allow_call_time_pass_reference 03/23/2003). At the time, I don't know why, but I couldn't find any info. I now have read the posts previosu to mine and understand the issue. If you are an administrator and can delete that post, please do (along with this part of this message if possible). I have another issue now that I can't seem to find any info on. Using phpXpath 3.3 I am able to import xml using both the importFromFile() and importFromString() methods. I am also able to use the getData() and exportAsXml() methods. However my application calls for using appendChild() / insertChild() and insertData() calls inbetween. For some reason, my appendChild() calls are returning the following errors: XPath error in oop.xpath.php:1673 In importFromString(): XML error in given string on line 1 column 0. Reason:syntax error XPath error in oop.xpath.php:5272 XPath error in oop.xpath.php:1673. Message: In importFromString(): XML error in given string on line 1 column 0. Reason:syntax error When I comment out the appendChild() call, both errors disappear. I tried setting $bDebugThisFunction of importFromFile() to true, and got the following (abbreviated) output: Setup for parse 1 ms Parse Object 4 msArray ( [0] => [1] => /text()[1] [2] => /MyRootNode[1] [4] => /SubNodeOne[1]/text()[1] ... [22] => /SubNodeOne[1]/text()[3] [23] => /text()[2] ) My appendChild() call looks like this: $XpathObject->appendChild("/MyRootNode[1]/SubNodeOne[1]", "SubNodeTwo"); Is the error coming from a problem with my method call, or is it from the fact that the zero element of this array is empty / null? How can I fix this? I tried substituting the version 2.2 class source file instead of version 3.3, and everything works fine. After viewing my xml files using several text editors, I've come to the conclusion that the error is not because of whitespace at the beginning of the document. I get this error from both importFromString() and importFromFile(), since the latter actually calls the first. Can anyone shed any light on why this is happening? Thanks! Dan xp...@da... |