I'm trying to use the XSLTProcessor class in php to generate xhtml from a .dita file based on the DITA Open Toolkit's xslt files.
The XSLTProcessor is working with simple xml and xslt files (e.g. with the samples on wikipedia), but it fails with the Open Toolkit's xsls.
The intresting part is that everything works well, if I use xsltproc command from bash on the same computer on the same files (I used no switches).
So, here's my code:
<?php
$sXML = file_get_contents('concepts/tools.xml');
# LOAD XML FILE
$XML = new DOMDocument();
$XML->loadXML( $sXML );
# START XSLT
$xslt = new XSLTProcessor();
$XSL = new DOMDocument();
$XSL->load( 'xsl/dita2xhtml.xsl');
$xslt->importStylesheet( $XSL );
#PRINT
print $xslt->transformToXML( $XML );
And instead of a valid xhtml file I get an output like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE span PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept
{""}) </span>
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept/title
{""}) </span>Tools<span style="font-weight: bold"> (title]</span></span>
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept/shortdesc
{""}) </span>Invest in a good set of tools for doing all kinds of tasks around the house.<span style="font-weight: bold"> (shortdesc]</span></span>
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept/conbody
{""}) </span><span style="background-color: yellow;"><span style="font-weight: bold">[/concept/conbody/p
{""}) </span>Useful tools include the following items:<span style="font-weight: bold"> (p]</span></span> (...)
It's just the first part of the output, but I didn't want copy the whole text here.
Both the xsl file and dita concept file is from the DITA Open Toolkit.
Any ideas what's wrong?