XML & XSLT
Posted: Fri Jul 12, 2002 8:38 am
Please help. I'm a newbie and I'm drastically stuck.
I have a database which stores data in xml format but I want to parse it with xslt to produce the format I want. The problem is I have followed everything on php.net to the letter and yet still I'm nowhere. Please take a look at the code below and tell me where I've gone wrong.
The screen returns:
"Warning: Sablotron error on line 1: XML parser error 2: syntex error in /home/httpd/html/ctan/resultworkingcopy2.php on line 88
XSLT processing error: XML parser error 3: syntex error "
WHAT GIVES?
I'm hopelessly lost and would greatly appreciate it if a kind soul would help me out! Cheers and thanks in advance!
Chia
I have a database which stores data in xml format but I want to parse it with xslt to produce the format I want. The problem is I have followed everything on php.net to the letter and yet still I'm nowhere. Please take a look at the code below and tell me where I've gone wrong.
Code: Select all
if (! empty($searchword ))
$query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
$result = mysql_query($query)
or die ("Query failed");
$line = mysql_fetch_array($result, MYSQL_ASSOC);
// var_dump($line);
// Create an array
$arguments = array( 'xml' => $line);
// Checking if array works
if ( is_array($arguments) )
print "It's an array! ";
// Show contents of an array
print_r ($arguments);
// Create an XSLT processor
$xsltHandler = xslt_create();
// Perform the transformation
$html = xslt_process($xsltHandler, 'arg:xml' , 'sheet1.xsl', NULL, $arguments);
// Detect errors
if (!$html) die ('XSLT processing error: '.xslt_error($xsltHandler));
// Destroy the XSLT processor
xslt_free($xsltHandler);
// Output the resulting HTML
print $html;"Warning: Sablotron error on line 1: XML parser error 2: syntex error in /home/httpd/html/ctan/resultworkingcopy2.php on line 88
XSLT processing error: XML parser error 3: syntex error "
WHAT GIVES?
I'm hopelessly lost and would greatly appreciate it if a kind soul would help me out! Cheers and thanks in advance!
Chia