Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Friday, February 26, 2016

Multiple PHP Warnings in XSLTProcessor::importStylesheet()

Multiple PHP Warnings in XSLTProcessor::importStylesheet()


Errors:

  Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]:   Undefined variable in /transform.php on line 24    Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]:   compilation error: file /protocols.xsl line 18 element template in /transform.php on line 24    Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]:   Failed to compile predicate in /transform.php on line 24    Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]:   Undefined variable in /transform.php on line 24    Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]:   compilation error: file /home6/oneninfi/public_html/craigfreeman/iphone/project1/protocols.xsl line 22 element template in /transform.php on line 24    Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]:   Failed to compile predicate in /transform.php on line 24    Warning: XSLTProcessor::transformToXml() [xsltprocessor.transformtoxml]:   No stylesheet associated to this object in /transform.php on line 35  

PHP:

$xsl = new XSLTProcessor();      $xsldoc = new DOMDocument();      $xsldoc->load($_GET['xsl'].'.xsl'); // protocols.xsl      $xsl->importStyleSheet($xsldoc); // LINE 24        if(isset($_GET['sectionNumber']))      	$xsl->setParameter('', 'sectionNumber', $_GET['sectionNumber']);      if(isset($_GET['protocolNumber']))      	$xsl->setParameter('', 'protocolNumber', $_GET['protocolNumber']);      if(isset($_GET['entryNumber']))      	$xsl->setParameter('', 'entryNumber', $_GET['entryNumber']);        $xmldoc = new DOMDocument();      $xmldoc->load($_GET['xml'].'.xml');      echo $xsl->transformToXML($xmldoc); // LINE 35  

XSL:

                     // LINE 18             // LINE 22    

(.

 STOP
  • XML:

        	
    Verify patient is pulseless and apneic. Initiate or continue CPR. CPR is to be continued at all times, except during defibrillation and /or interruptions < 10 sec for patient transfer. Assure airway patency and begin use of BVM. Provide initial BLS airway management, including Oropharyngeal or Nasopharyngeal Airway. Apply AED or SAED if available. If AED already in place, wait until current shock sequence completion to switch to another AED or manual monitor ? may use previously applied patches if compatible with new unit. Follow prompts provided by AED/SAED device. Utilize ALS, or initiate timely transport toward ALS (ALS intercept or hospital if closer). If ALS not available, no more than 3 shocks should be delivered at the scene. Defibrillation should not be performed in a moving ambulance. Advise receiving hospital ASAP. If AED/SAED not already applied, quick look using manual monitor and defibrillate PRN after CPR of at least 5 cycles (about 2 minutes). Apply limb leads and pads in between shock sequences as appropriate. Obtain vascular access. Secure definitive airway. If BLS airway is sufficient to maintain chest rise, continue until additional time or resources are available. If unable to intubate, continue use of BLS airway adjuncts or use alternate airway device.

    emove Bag Valve device whenever transferring patient, moving patient in and out of Ambulance, or other times when Bag Valve device may dislodge the device.

    Reassess airway patency after any movement of patient.
    Give medications as listed in the following specific arrhythmia / dysrhythmia protocols. Should IV/IO access not be available, Epinephrine, Atropine, and Lidocaine may be administered via ETT under direct, on-line Medical Control.

    PHP5 XML/XSL enabled

    Thoughts? Anything obvious??

    Answer by Alexandru Luchian for Multiple PHP Warnings in XSLTProcessor::importStylesheet()


    Looks to me that $_GET['xsl'] is empty.

    Answer by dnagirl for Multiple PHP Warnings in XSLTProcessor::importStylesheet()


    Your xsl has an error in it. When you load it into the XSLTProcessor object, it fails. Therefore you can't apply it the the xml.

    Answer by Alexandru Luchian for Multiple PHP Warnings in XSLTProcessor::importStylesheet()


    Look at this error: Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: compilation error: file /protocols.xsl line 18 element template in /transform.php on line 24

    On line 18 you have:

    // LINE 18

    Where is $sectionNumber defined? PHP cannot see it.

    Answer by Jim Garrison for Multiple PHP Warnings in XSLTProcessor::importStylesheet()


    One possibility is that the XSL processor is really complaining about   not being declared as an entity. Try changing the doctype to

     ] >  

    Answer by JS. for Multiple PHP Warnings in XSLTProcessor::importStylesheet()


    i've experienced the same issue, seems to be an issue in XSLTProcessor if you call an XSL with a parameter, define the parameter on `