We are trying to import a simple HTML file from the server file system, and we are getting these errors:
- warning: unlink(files/playgrounds/imported/index.htm): No such file or directory in /home/colaborativa/domains/drupal-dev.colaborativa.net/public_html/drupal-4.7.3/modules/contrib/import_html/import_html.module on line 1345.
- user notice: Problem parsing XML String in /home/colaborativa/domains/drupal-dev.colaborativa.net/public_html/drupal-4.7.3/modules/contrib/import_html/coders_php_library/xml-transform.inc on line 183.
- user warning: Failed to rewrite links into a valid XML file in /home/colaborativa/domains/drupal-dev.colaborativa.net/public_html/drupal-4.7.3/modules/contrib/import_html/import_html.module on line 1882.
- user warning: Nothing useful extracted via XML from that content in /home/colaborativa/domains/drupal-dev.colaborativa.net/public_html/drupal-4.7.3/modules/contrib/import_html/import_html.module on line 1420.
- No body content found in this node
We have PHP 4.3.11, with DOMXML extensions loaded. From the infoo.php
...
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20606
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.0.33
libxslt compiled against libxml Version 2.5.11
DOM/EXSLT enabled
libexslt Version 1.0.33
...
We had to comment out the function init_xsl() because it was trying to dinamically load the extension that was already loaded (installed by RPM).
Around xml_transform.inc line 183, it reads:
else if ( extension_loaded ( "domxml" )) {
///////////
// PHP 4 //
if($xmldoc = domxml_open_mem($xmlsource))
return $xmldoc;
trigger_error('Problem parsing XML String');
#dsm($xmlsource);
return NULL;
It seems that domxml_open_mem() fails for some reason.
We have HTMLTidy working from the command line, but XSL support does not seem to work. Any hints? (the same happens with every HTML page that we tried)
TIA
Comments
Comment #1
dman commentedTricky.
Good report tho!
I've fired up a clean install to see what's up in PHP4. It's been a load of trouble. XSL support was strictly experimental in PHP, all through the 4.X versions before being totally re-written in 5.
I can test in 4.4.1, and it holds together.
4.3 looks like it just may not go.
Your info looks very useful... but I'm not sure how to x-reference it back to the CVS versions of all those dependancies!
You debugs indicate that SOMETHING calling itself domxml is available, but it's not working as expected.
Need to try a little simpler stand-alone (but within PHP) XML support testing, I guess.
AH! A comment on PHP.net indicates that UTF encoding can cause problems ... But no, it's coming from a string. Can't be that.
OK. Turn on debug! That will display (a lot of) before and after dumps of the process in progress. Could be, I dunno, something invalid in the source (ampersands?) getting through that HTMLTidy didn't catch. There are a few things that can slip under its radar that I've already had to strip by hand. PHP tags for example get confused with XML directives.
up the top, set
where it was 0.
You see that commented dsm()? that's a debug function from from devel.module
replace it with
you should get a lot more visibility. We'll see exactly where the content went missing.
... and starting at the top (like maybe I should have) ... the unlink not working implies that maybe there was simply no input created and happening at all! Maybe it was all much earlier, closer to the htmltidy phase...
Comment #2
dman commentedCorrection:
You have to shift that define() outside of the little if() it's in, depending on what else you have installed.
I've identified a problem with the tidy extension. It also went through a metamorphisis between v 4 & 5
It claims to exist, but doesn't run as expected. I'll post a patch soon.
Comment #3
dman commentedSeveral rounds of tweaking to handle variations of PHP4 XML have passed.
If it's still causing problems I'll just have to say upgrade to a known good platform (4.4+)
Not worth supporting bad implimentations that I can no longer even install well enough to test.