XSL Transformation server behavior doesn't work with PHP 5.1.4An XSLT fragment
embedded in a PHP page using the XSL Transformation server behavior triggers
the following MM_XSLTransform error when processed by a PHP 5.1.4 server:
MM_XSLTransform error.
http://newsrss.mysite.com/rss/rss.xml is not a valid XML document.
Non-static method DOMDocument::loadXML() should not be called statically,
assuming $this from incompatible context in file
http://newsrss.mysite.com/rss/rss.xml.
The error message incorrectly reports that the XML data source is not a valid
XML document. The same page displays successfully when processed by a PHP 5.1.2
server. This problem occurs in Dreamweaver 8.0, 8.0.1 and 8.0.2 and is due to
the use of a static function call that was newly deprecated in PHP 5.1.4. (Ref.
207225)
I don't have PHP 5.2.6 installed. I'm running 5.2.5, and there's
absolutely nothing wrong with the code used in the 8.0.2 hotfix. The
error message you're quoting says DOMDocument::loadXML() should not be
called statically. The code used in the hotfix doesn't call it
statically. That was the fix - *not* to call it statically.
It sounds as though you're using an old version of
MM_XSLTransform.class.php. You can check whether you have the right
version by looking at lines 301-303. They should look like this:
// $xml = DOMDocument::loadXML($content);
$doc = new DOMDocument();
$err = $doc->loadXML($content);
Note that the first line is commented out. That's the line that caused
the error. The next two lines fixed the problem.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
// $xml = DOMDocument::loadXML($content);
$doc = new DOMDocument();
$err = $doc->loadXML($content);
This was expected since I have the 802 hot fix installed.
As I said the problem was fixed up to php 5.2.5. Going to php 5.2.6. has
broken this again. I don't know what has changed in php 5.2.6 that might cause
this.
Are you able to confirm this problem in php 5.2.6?
If confirmed, what is the process for raising a bug and will Adobe fix it?
No. I have installed PHP 5.2.6 on a different machine, and tested the
XSL Transformation server behavior. It works exactly the same as in 5.2.5.
> If confirmed, what is the process for raising a bug and will Adobe fix it?
I cannot confirm the problem, so there's nothing I can see for Adobe to
fix. However, the correct channel for reporting bugs is through the form
at the following address:
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
Even if a problem can be identified, it's highly unlikely that Adobe
would issue an updated version of the 8.0.2 hotfix. The hotfix worked
perfectly with the version of PHP that was current at the time. Since
then, CS3 has been released, and CS4 is being officially announced next
Tuesday. If a fix is required (and I don't believe one is), the normal
policy is to supply it for the current version of Dreamweaver, not one
that is no longer on sale.
The error message says exactly what's wrong. The following line of code
calls DOMDocument::loadXML() statically:
$xml = DOMDocument::loadXML($content);
If that line is commented out in MM_XSLTransform.class.php, you
shouldn't get the error. The fact that you're getting it must indicate
that your page is linking to the old version of
MM_XSLTransform.class.php. I don't see anything else that could cause
the error.
I have just ried my site on a 2nd web host also with php5.2.6 and it works!
So you're right the code is ok.
So I guess I have a web server problem.
I have checked the adobe docs and I need:
For PHP 5:
DOM/XML
libXML
XSL
libxslt
Here is an excerpt of my phpinfo()
dom
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.32
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
libxml
libXML support active
libXML Version 2.6.32
libXML streams enabled
Both web host's phpinfo() are exactly the same!
Please can you help me identify what is wrong with my main host (1and1).
Thanks
Yes, most of the community experts, as well as a lot of the other people
who answer questions, use a newsreader. Editing messages in the web
interface tends to lead to confusion. Thanks for reposting.
> I have just ried my site on a 2nd web host also with php5.2.6 and it works!
> So you're right the code is ok.
Thanks for the confirmation.
> Both web host's phpinfo() are exactly the same!
>
> Please can you help me identify what is wrong with my main host (1and1).
That error is caused by this line:
$xml = DOMDocument::loadXML($content);
The most likely cause is that the old version of
MM_XSLTransform.class.php has somehow been uploaded to the host where
you get the error. Delete MM_XSLTransform.class.php and upload a clean,
new version.
Sorry. No idea. As you have already verified, the problem doesn't lie
with the Dreamweaver script. I don't see how that error could be
generated on PHP 5.2.6 unless it's calling an old script.
By default "fopen" function is disabled in php 5. order to enable it
you have to activate or turn on fopen function in php.ini.
allow_url_fopen = On
allow_url_include = On
1and1 speak with forked tongue. The default settings in PHP 5.2 are as
follows:
allow_url_fopen = On
allow_url_include = Off
You should not normally enable allow_url_include as it represents a
serious security risk. There should be no risk with allow_url_fopen.