Re: [Xsltforms-support] Is it possible to generate an xhtml with php, based on xsltforms?
Brought to you by:
alain-couthures
From: COUTHURES A. <ala...@ag...> - 2009-09-10 20:19:23
|
Hello Lorenzo, > Is it possible to generate an xhtml document with an xform with php, > based on xsltforms? > $xsl->importStyleSheet($doc); > $doc->load($xml_filename); > echo $xsl->transformToXML($doc); Yes, php might be used at server-side to perform an xslt transformation, with instructions such as : |$xsl = new XSLTProcessor(); $xsl->importStyleSheet(DOMDocument::load($xsl_filename)); echo $xsl->transformToXML(DOMDocument::load($xml_filename)); | Unfortunately, php xslt engine doesn't support namespaces very well and workarounds have to be found (add dummy attributes such as xsd:dummy="dummy" so the XSLTForms stylesheet can find the corresponding URI,...). > > I have tried, but it seems it needs the <?xml-stylesheet > href="../xforms/xsltforms/xsltforms.xsl" type="text/xsl"?> line to > understand where are the xsltforms subfolders. Usually, a processing-instruction is used only for client-side transformation but at server-side, the source document beeing loaded with the DOM API, it's also possible to have php instructions to manually read this processing-instruction to, first, locate the stylesheet. Best regards, -Alain |