I'm trying to transform an XSL-FO file to HTML using the Php XSLTProcessor. Here what I do :
public static function toHTML($xml)
{
// init
$xp = new XSLTProcessor();
$xmlDoc = new Mv_Dom_Document();
$xmlDoc->loadXML($xml);
$dirXslt = $GLOBALS['G_config']['XSLT_STYLESHEETS'].'fo2html/';
$aXsltSS = GestionFichiers::getDirContent($dirXslt);
// chargement des feuilles de styles XSLT pour la conversion
foreach ($aXsltSS AS $stylesheet) {
$xslDoc = new Mv_Dom_Document($stylesheet->getRealPath());
$xp->importStylesheet($xslDoc);
unset($xslDoc);
}
// transformation HTML > XML
return $xp->transformToXML($xmlDoc);
}
dönüştürme sırasında ama ben aşağıdaki hatayı alıyorum:
ERREUR - XSLTProcessor::transformToXml() [<a href='xsltprocessor.transformtoxml'>xsltprocessor.transformtoxml</a>]: xsltApplySequenceConstructor: apply-templates was not compiled
ERREUR - XSLTProcessor::transformToXml() [<a href='xsltprocessor.transformtoxml'>xsltprocessor.transformtoxml</a>]: xsltApplySequenceConstructor: apply-templates was not compiled
ERREUR - XSLTProcessor::transformToXml() [<a href='xsltprocessor.transformtoxml'>xsltprocessor.transformtoxml</a>]: xsltApplySequenceConstructor: if was not compiled
Benim XSL-FO dönüştürmek için doğrudan apache fop uzantısını kullanmaya çalıştığınızda, dönüşüm başarılı, neden php biri başarısız?
PS: Ben uygun stil ile Html2fo gibi, XSLTProcessor ile diğer şeyler dönüştürmeye çalıştığınızda, ben herhangi bir sorun olsun.
Teşekkürler daha önce.
EDIT : the stylesheet have been downloaded from apache svn on http://svn.apache.org/repos/asf/db/derby/docs/trunk/lib/fo2html.xsl, and here the input sample i've been using for testing :
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" line-stacking-strategy="font-height">
<fo:layout-master-set>
<fo:simple-page-master margin-bottom="35.4pt" margin-left="27pt" margin-right="19.3pt" margin-top="35.4pt" master-name="pm0" page-height="841.9pt" page-width="595.3pt">
<fo:region-body margin-bottom="-17.4pt" margin-top="-17.4pt" overflow="visible" region-name="body"/>
<fo:region-before extent="771.1pt" overflow="visible" region-name="header"/>
<fo:region-after display-align="after" extent="771.1pt" overflow="visible" region-name="footer"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="pm0" orphans="2" white-space-collapse="false" widows="2">
<fo:flow flow-name="body">
<fo:block end-indent="0pt" line-height="13.7pt" start-indent="0pt" text-align="start" text-indent="0pt">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" role="html:body" font-family="Times Roman, serif" font-size="12pt">
<fo:inline role="html:span" font-weight="bold">
<fo:inline text-decoration="underline" role="html:u">Informations sur le patient</fo:inline>
</fo:inline>
</fo:block>
</fo:block>
<fo:block line-height="13.7pt">
<fo:leader line-height="13.7pt"/>
</fo:block>
<fo:block line-height="13.7pt">
<fo:leader line-height="13.7pt"/>
</fo:block>
<fo:block end-indent="0pt" line-height="11.4pt" start-indent="0pt" text-align="start" text-indent="0pt">
<fo:inline font-family="Times Roman, serif" font-size="10pt">
<fo:inline role="html:body" font-weight="bold">
idPATIENT :
</fo:inline>
<fo:inline role="html:body">
1
</fo:inline>
</fo:inline>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>