Re: Am I a doofus?
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-08-08 12:58:19
|
> > I'm not really sure what isn't working if anything, or what it's meant to > > do.... but $resultarray is never set, so it will never execute any of the > > inside of the foreach($resultarray as ....) loop, hence the above code isn't > > really going to do a whole lot... > > Okay, my fault, I forgot to mention that I snipped parts of the code away to shorten it and to focus > attention on the matter in hand. An honourable intention. For which I am thankful. Better still is to snip away as much as possible, but then confirm that it still runs and fails as you expect :o). > > > It would be most helpful if you could attach .php/.xml/.html > > files that I can copy out and run and examine the output against your output > > to a) see if I get the same results and then b) work out if those results > > are "correct". > > Oh, I didn't do that in the first place - I reckoned you got tons of mails like this and wanted to > spare you the troubles. I do get a fair few mails, but if I get mails with php inline in the email, then all I end up doing is creating a junk.php file and pasting the php in then running it, so it's actually much easier if you just mail .php/.xml files in their entirity. What is annoying is getting php snippets with no xml to run them against. That means I have do debug by "inspection" which is much harder than by "iteration". There is however no need to mail me the XPath.class.php, as I have access to the source for that. Mentioning the cvs version of the file should be all that's necessary. > Anyhoo, I've attached 'bot_db.xml', 'cms_searchengine_createindex2.php', as > well as the 'xpath.class.php' I'm using. I've commented the code slightly. If I've left something in > a blur, I'll be happy and ready to clear things up. Ok I made a one line change to get rid of the index errors. You had: $myindex->appendData($myindex->appendChild($xmlpage,"item"),$itemvalue); Which should have read: $myindex->appendData($myindex->appendChild($xmlpage,"<item/>"),$itemvalue); And then I hit the 30 second execution time limit. So I trimmed the bot_db.xml down to just the first and last "pages" then re-ran and produced search_index.xml. Without studying the code in detail, search_index.xml looks "roughly" right. Is it? If not could you manufacture a small input .xml file, and then show me what the output.xml file should look like? Nigel |