[support] CANCEL: errors when trying to add PHP page that loads XML and XSL file

Tim McGeary tmm8 at Lehigh.EDU
Wed Oct 24 19:03:19 UTC 2007


Cancel this request.  User error...  typo...  :(  [sigh]

Tim


Tim McGeary wrote:
> 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
> 
> 


More information about the support mailing list