[PHP] Using two XSLT stylesheets
I'm working on a read only database. I have the data encoded as XML and am writing the queries using XSLT stylesheets. The only way I can find (being, of course, restricted to XSLT 1.0 on PHP) of executing the required queries requires two stylesheets. The generates a result tree which needs to be proceesed by the second. But I can't find a way of doing this. I've tried: xslt_process($xh, 'library.xml', 'simple-search-get-results.xsl', -- 'results.xml', NULL, $params); $data = xslt_process($xh, 'results.xml', -- 'simple-search-display-results.xsl', NULL, NULL, NULL); and: $results = xslt_process($xh, 'library.xml', 'simple-search-get-results.xsl', -- NULL, NULL, $params); $data = xslt_process($xh, $results, 'simple-search-display-results.xsl', -- NULL, NULL, NULL); neither of which work at all. Any ideas? Cheers, rich. -- UEA/MUS::Record Library http://www.cursus.uea.ac.uk/cdlib/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using two XSLT stylesheets
xslt_process($xh, 'library.xml', 'simple-search-get-results.xsl', -- 'results.xml', NULL, $params); $data = xslt_process($xh, 'results.xml', -- 'simple-search-display-results.xsl', NULL, NULL, NULL); What happens when you do the above...what is the var_dump of data? -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using two XSLT stylesheets
Ray Hunter wrote: xslt_process($xh, 'library.xml', 'simple-search-get-results.xsl', -- 'results.xml', NULL, $params); $data = xslt_process($xh, 'results.xml', -- 'simple-search-display-results.xsl', NULL, NULL, NULL); What happens when you do the above...what is the var_dump of data? -- BigDog I get this: Warning: Sablotron error on line 1001: cannot open file '/var/www/html/cdlib/search/results.xml' in /var/www/html/cdlib/search/simple-search.php on line 24 string(591) line 24 is the first call to xslt_process() above. But I'd never tried using var_dump($data) before. It appears the the second call is working fine: the file 'results.xml' exists already becasue I've been using a command line XSL processor to test the stylesheets. The second call to xslt_process() appears to have read and processed the data which was in that file correctly because var_dump() has inserted the result into the HTML following the error message. -- Richard UEA/MUS::Record Library -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php