Re: PhpXpath 3.3
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2003-04-09 22:59:50
|
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). The issue was always somewhat fuzzy in my mind, so I was hoping someone = else would chip in and answer your question.... the email was still in = my inbox :o/ Glad you got the answer you were looking for though! 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: <snip> My appendChild() call looks like this: $XpathObject->appendChild("/MyRootNode[1]/SubNodeOne[1]", = "SubNodeTwo"); Try=20 $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! It was a change in the appendChild() call between 2.2 and 3.3 that we = obviously didn't document well enough (you aren't the first to get stung = by this). Previously you could only append a single new element, but = now you can do cool stuff like=20 $XpathObject->appendChild("/MyRootNode[1]/SubNodeOne[1]", = "<a><b/><c/></a>"); Cheers Nigel |