Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP+XMLT processor

Status
Not open for further replies.

nizarhandal

Programmer
Aug 3, 2006
6
PS
I keep getting the following error for the below PHP code:

The error:
----------

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Undefined variable in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: compilation error: file /var/ line 97 element img in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Attribute template src: failed to compile $href_quicklook in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Undefined variable in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: compilation error: file /var/ line 97 element img in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Attribute template width: failed to compile $width in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Undefined variable in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: compilation error: file /var/ line 97 element img in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Attribute template height: failed to compile $height in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Undefined variable in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: compilation error: file /var/ line 205 element img in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Attribute template src: failed to compile $href_quicklook in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Undefined variable in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: compilation error: file /var/ line 205 element img in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Attribute template width: failed to compile $width in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Undefined variable in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: compilation error: file /var/ line 205 element img in /var/ on line 27

Warning: XSLTProcessor::importStylesheet() [function.XSLTProcessor-importStylesheet]: Attribute template height: failed to compile $height in /var/ on line 27

Warning: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml]: No stylesheet associated to this object in /var/ on line 37

xslt.inc.php:
-------------
<?php
if (PHP_VERSION >= 5) {
// Emulate the old xslt library functions
function xslt_create() {
return new XsltProcessor();
}

function xslt_process($xsltproc,
$xml_arg,
$xsl_arg,
$xslcontainer = null,
$args = null,
$params = null) {
// Start with preparing the arguments
$xml_arg = str_replace('arg:', '', $xml_arg);
$xsl_arg = str_replace('arg:', '', $xsl_arg);

// Create instances of the DomDocument class
$xml = new DomDocument;
$xsl = new DomDocument;

// Load the xml document and the xsl template
$xml->loadXML($args[$xml_arg]);
$xsl->loadXML($args[$xsl_arg]);

// Load the xsl template
$xsltproc->importStyleSheet($xsl);

// Set parameters when defined
if ($params) {
foreach ($params as $param => $value) {
$xsltproc->setParameter("", $param, $value);
}
}

// Start the transformation
$processed = $xsltproc->transformToXML($xml);

// Put the result in a file when specified
if ($xslcontainer) {
return @file_put_contents($xslcontainer, $processed);
} else {
return $processed;
}

}

function xslt_free($xsltproc) {
unset($xsltproc);
}
}
?>

Any help plz?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top