xsl-list
[Top] [All Lists]

[xsl] php xslt transformation problem

2011-07-04 19:23:54
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();
    $xml->load'test.xml');
    $xslt = new XSLTProcessor();
    $xsl = new DOMDocument();
    $xsl->load('xsl/readFile.xsl');
    $xslt->importStylesheet($xsl);
    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. 

Thanks,

David
djbpitt(_at_)pitt(_dot_)edu


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>