[xsl] php xslt transformation problem

Subject: [xsl] php xslt transformation problem
From: "Birnbaum, David J" <djbpitt@xxxxxxxx>
Date: Mon, 4 Jul 2011 20:23:41 -0400
Dear xsl-list,

I seem to have hit a blind spot with PHP (5.3) XSLT transformation and I would
be grateful if someone could point me in the right direction. The relevant
part of my php (including some temporary print diagnostics) is:

    $xml = new DOMDocument();
    $xslt = new XSLTProcessor();
    $xsl = new DOMDocument();
    print $xml->saveXML();
    print $xsl->saveXML();
    if ($xslt->transformToXML($xml)) {
        print $xslt->transformToXML($xml);
    } else {
        print "Failed to transform";

Printing the $xml and $xsl reproduces the original input files (with non-ascii
characters in the $xml transformed into numerical character references), which
would seem to confirm that they're being read. The transformation, however,
fails. In case it makes a difference, the files are UTF-8 and the $xml one has
a lot of non-ascii characters. Both files are well-formed and valid against
their schemas.

The PHP simplexml approach also failed.

There's a sample xml file at http://menology.obdurodon.org/test.xml and the
xsl is at http://menology.obdurodon.org/xsl/readFile.xsl.



Current Thread