Vielleicht hat jemand eine Idee. Ich wollte mit Php eine XSL-Transformation machen, bekomme aber immer folgende Fehlermeldung:
Sorry, sample.xml could not be transformed by sample.xsl into result.xml the reason is that XML parser error 3: no element found and the error code is 2
der php-code:
// Allocate a new XSLT processor
$xh = xslt\_create();
// Process the document, returning the result into the $result variable
$result = xslt\_process($xh, 'sample.xml', 'sample.xsl');
if ($result) {
print "SUCCESS, sample.xml was transformed by sample.xsl into the \$result";
print " variable, the \$result variable has the following contents\n
\n";
print $result;
}
else {
print "Sorry, sample.xml could not be transformed by sample.xsl into";
print " the \$result variable the reason is that " . xslt\_error($xh) .
print " and the error code is " . xslt\_errno($xh);
}
xslt\_free($xh);
das XML-Dokument:
<?xml version='1.0' encoding='UTF-8'?> A Short Example Section #1A short example of a Simplified DocBook file.
das XSL-Dokument:
Das Beispiel stammt von:
http://www.zend.com/zend/tut/tutorial-wong3.php
Was mache ich falsch? Hat jemand etwas ähnliches erlebt?
Ich verwende PHP Version 4.2.3 - ‚–enable-xslt‘ ‚–with-xslt-sablot‘ .
Womit transformierst Du xml?
Gruß Christian