From:             cross_phil at hotmail dot com
Operating system: Windows XP Pro
PHP version:      4.3.4
PHP Bug Type:     XSLT related
Bug description:  xsl:copy-of not working properly

Description:
------------
I am using the sablotron xsl extension to transform xml files.  The
xsl:copy-of tag does not appear to work properly.  It should copy the tree
fragment entirely to the result document but it only copies element tags. 
Some of the elements contain text within them (ie: <test>some text</test>
would copy as <test></test> without the text).  I am convinced that my
code is fine because other transforms that don't use this tag work fine
and there are somre pretty crazy transforms that I am trying to run.

Reproduce code:
---------------
My XML data:
<?xml version="1.0"?>
<testroot>
        <testelement>
                <anotherelement>
                        some text
                </anotherelement>
                <and_again>
                        some more text
                </and_again>
        </testelement>
</testroot>

My XSL sheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:template match="testelement">
                <xsl:copy-of select="."/>
        </xsl:template>
</xsl:stylesheet>

My PHP Code:
$xslp = xslt_create();
echo xslt_process($xslp, 'in.xml', 'xsl.xsl');
xslt_free($xslp);


Expected result:
----------------
<testelement>
  <anotherelement>
    some text
  </anotherelement>
  <and_again>
    some more text
  </and_again>
</testelement>


Actual result:
--------------
<?xml version="1.0" encoding="UTF-8" ?> 
<testelement>
  <anotherelement /> 
  <and_again /> 
</testelement>

-- 
Edit bug report at http://bugs.php.net/?id=28097&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28097&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28097&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28097&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28097&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28097&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28097&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28097&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28097&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28097&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28097&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28097&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28097&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28097&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28097&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28097&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28097&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28097&r=float

Reply via email to