[support] errors when trying to add PHP page that loads XML and XSL file
Tim McGeary
tmm8 at Lehigh.EDU
Wed Oct 24 18:41:51 UTC 2007
Hi all,
We are trying to add a short PHP file to our Drupal site that loads an
XML and XSL file and displays them. When I click preview or save, I get
the following warnings in the display:
* warning: DOMDocument::load() [function.DOMDocument-load]: I/O
warning : failed to load external entity
"/home/local/lib_drupal/files/ejournal/a.xml" in
/home/local/lib_drupal/includes/common.inc(1342) : eval()'d code on line 5.
* warning: XSLTProcessor::transformToXml()
[function.XSLTProcessor-transformToXml]: Invalid or inclomplete context
in /home/local/lib_drupal/includes/common.inc(1342) : eval()'d code on
line 14.
The PHP script we are trying use is:
<?php
// Load the XML source
$xml = new DOMDocument;
$xml->load('files/ejournal/a.xml');
$xsl = new DOMDocument;
$xsl->load('files/ejournal/ej.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml);
?>
Why am I getting these warnings and what can I do to correct them? I
don't know if this is a Drupal issue or PHP issue.
Thanks,
Tim
--
Tim McGeary '99, '06G
Senior Systems Specialist
Lehigh University
610-758-4998
tim.mcgeary at lehigh.edu
More information about the support
mailing list