ID: 39299 User updated by: pascal dot heus at gmail dot com Reported By: pascal dot heus at gmail dot com -Status: Feedback +Status: Open Bug Type: XSLT related Operating System: GNU/Linux PHP Version: 5.1.6 New Comment:
<?php // Code to illustrate bug #39299 // Differences in XSLT's are at lines 56/57 echo 'pHp '.phpversion(); $xmlDom = new DomDocument(); $xmlDom->load('http://scs.gmu.edu/~rgomez/qc/xml/gmu.xml'); $xslDom = new DomDocument(); // Comment/uncomment lines below to select XSLT file $xsl = 'http://scs.gmu.edu/~rgomez/qc/xml/gmu_program_schedule_bug_fails.xslt'; //$xsl = 'http://scs.gmu.edu/~rgomez/qc/xml/gmu_program_schedule_bug_works.xslt'; echo "<p>Using $xsl</p>"; $xslDom->load($xsl); $proc = new XsltProcessor(); $xslDom = $proc->importStylesheet($xslDom); $outputDom = $proc->transformToDoc($xmlDom); echo $outputDom->saveHTML(); ?> Previous Comments: ------------------------------------------------------------------------ [2006-10-29 17:18:46] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-10-29 15:24:51] pascal dot heus at gmail dot com Description: ------------ The following xsl code works fine with the Sablotron engine under pHp4 or with XMLSpy: <xsl:key name="course-key" match="/gmu/programs/[EMAIL PROTECTED]//courseRef" use="concat(@subject,@course,@subcourse)"/> When using libxslt under pHp 5, it fails to execute. The problem comes form the $program-id variable used in the match= attribute. If I replace it with a hard coded value, the XSLT works fine: <xsl:key name="course-key" match="/gmu/programs/[EMAIL PROTECTED]'csi-phd-qis']//courseRef" use="concat(@subject,@course,@subcourse)"/> This is under pHp 5.0.4 running on an institutional server, I don't have the authority to upgrade that system for further testing. Reproduce code: --------------- You can retrieve the xslt and xml file at: http://scs.gmu.edu/~rgomez/qc/xml/gmu_program_schedule_bug.xslt http://scs.gmu.edu/~rgomez/qc/xml/gmu.xml ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39299&edit=1