I cannot figure this out. I think I have to change my PHP code, but I really don't know how to change it! Any help is appreciated!! I'm on Redhat 9, PHP 4.3.4, the PHP info is at http://www.noctambus.com/phpinfo.php
Here's my error:
Warning: Sablotron error on line 1: XML parser error 3: no element found in /home/httpd/vhosts/noctambus.com/httpdocs/reviews/xml/standardbrowser.php on line 85
Here's my code:
<?php
$CONF_XSL_FILE = "/home/httpd/vhosts/noctambus.com/httpdocs/reviews/xsl/standardbrowser.xsl";
$CONF_XML_DIR = "/home/httpd/vhosts/noctambus.com/httpdocs/reviews/xml/";
$transformer = new XSLTransformer();
if ($transformer->setXsl($CONF_XSL_FILE) && $transformer->setXml($CONF_XML_DIR . $x))
{
$transformer->transform();
echo $transformer->getOutput();
} else {
echo $transformer->getError();
}
/
XSLTranformer -- Class to transform XML files using
XSL with the Sablotron libraries.
/
class XSLTransformer {
var $xsl, $xml, $output, $error ;
/ Constructor /
function XSLTransformer() {
$this->processor = xslt_create();
}
/ Destructor /
function destroy() {
xslt_destroy_processor($this->processor);
}
/ output methods /
function setOutput($string) {
$this->output = $string;
}
function getOutput() {
return $this->output;
}
/ set methods /
function setXml($uri) {
if($doc = new docReader($uri)) {
$this->xml = $doc->getString();
return true;
} else {
$this->setError("Could not open $xml");
return false;
}
}
function setXsl($uri) {
if($doc = new docReader($uri)) {
$this->xsl = $doc->getString();
return true;
} else {
$this->setError("Could not open $uri");
return false;
}
}
/ transform method /
function transform() {
$arguments = array(
'/_xml' => $this->xml,
'/_xsl' => $this->xsl
);
$this->setOutput(
xslt_process($this->processor, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments)
);
$this->setError($err);
}
/ Error Handling /
function setError($string) {
$this->error = $string;
}
function getError() {
return $this->error;
}
}
/ docReader -- read a file or URL as a string /
class docReader {
var $string; // public string representation of file
var $type; // private URI type: 'file','url'
var $bignum = 1000000;
var $uri;
/ public constructor /
function docReader($uri) { // returns integer
$this->setUri($uri);
$this->setType();
$fp = fopen($this->getUri(),"r");
if($fp) { // get length
if ($this->getType() == 'file') {
$length = filesize($this->getUri());
} else {
$length = $this->bignum;
}
$this->setString(fread($fp,$length));
return 1;
} else {
return 0;
}
}
/ determine if a URI is a filename or URL /
function isFile($uri) { // returns boolean
if (strstr($uri,'http://') == $uri) {
return false;
} else {
return true;
}
}
/ set and get methods /
function setUri($string) {
$this->uri = $string;
}
function getUri() {
return $this->uri;
}
function setString($string) {
$this->string = $string;
}
function getString() {
return $this->string;
}
function setType() {
if ($this->isFile($this->uri)) {
$this->type = 'file';
} else {
$this->type = 'url';
}
}
function getType() {
return $this->type;
}
}
?>
THANKS SO MUCH FOR ANY HELP!!!!!!!!