示例#1
0
 function transform()
 {
     $args = array("/_stylesheet", $this->xsl, "/_xmlinput", $this->xml, "/_output", 0, 0);
     if ($err = xslt_run($this->processor, "arg:/_stylesheet", "arg:/_xmlinput", "arg:/_output", 0, $args)) {
         $output = xslt_fetch_result($this->processor, "arg:/_output");
         $this->setOutput($output);
     } else {
         $this->setError(xslt_error($this->processor));
         $this->setErrorCode(xslt_errno($this->processor));
     }
 }
示例#2
0
function INCLUDE_xml_xsl($xmlContent, $xslFile)
{
    $fp = fopen($xslFile, "r");
    if ($fp) {
        $xsl = fread($fp, "500000");
        fclose($fp);
    }
    $p = xslt_create(void);
    $args = array("/_stylesheet", $xsl, "/_xmlinput", $xmlContent, "/_output", 0, 0);
    $runFlag = xslt_run($p, "arg:/_stylesheet", "arg:/_xmlinput", "arg:/_output", 0, $args);
    $result = xslt_fetch_result($p, "arg:/_output");
    xslt_free($p);
    return utf8_decode($result);
}
 function transform()
 {
     //      	xslt_process($this->xsl, $this->xml, &$output, &$err);
     //		$this->setOutput($output);
     //		$this->setError($err);
     $args = array("/_stylesheet", $this->xsl, "/_xmlinput", $this->xml, "/_output", 0, 0);
     if ($err = xslt_run($this->processor, "arg:/_stylesheet", "arg:/_xmlinput", "arg:/_output", 0, $args)) {
         $output = xslt_fetch_result($this->processor, "arg:/_output");
         $this->setOutput($output);
     } else {
         $this->setError($err);
     }
     //if (strlen($output)==0) {echo "!3<br>";echo $err;}
 }
 function transform()
 {
     //              xslt_process($this->xsl, $this->xml, &$output, &$err);
     //              $this->setOutput($output);
     //              $this->setError($err);
     if (getenv("ENV_SOCKET") == "true") {
         //socket
         $result = $this->socket->transform($this->xsl, $this->xml);
         $this->byJava = 'true';
         $this->setOutput($result . "<!--transformed by SOCKET Java-->");
     } else {
         $args = array("/_stylesheet", $this->xsl, "/_xmlinput", $this->xml, "/_output", 0, 0);
         if ($err = xslt_run($this->processor, "arg:/_stylesheet", "arg:/_xmlinput", "arg:/_output", 0, $args)) {
             $output = xslt_fetch_result($this->processor, "arg:/_output");
             $this->byJava = 'false';
             $this->setOutput($output . "<!--transformed by PHP-->");
         } else {
             $this->setError($err);
         }
     }
 }