|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-02-17 08:29 UTC] chregu@php.net
[2008-02-17 09:46 UTC] daniel dot oconnor at gmail dot com
[2008-02-18 09:53 UTC] chregu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 28 09:00:01 2025 UTC |
Description: ------------ If an element + attribute are in a namespace, do both need to explicitly referenced with said namespace? Currently: //example:Numbers@sequence vs //example:Numbers@example:sequence Which is the correct behaviour? PHP currently chooses the first. Reproduce code: --------------- <?php /* bug.xsl <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:example="http://example.com/"> <xsl:template match="example:Numbers"> I expect to see 54321 54321 One Two Three Four Five after this point <xsl:value-of select="@sequence" /> <xsl:value-of select="@example:sequence" /> <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> */ /* bug.xml <?xml version="1.0" encoding="utf-8"?> <Example xmlns="http://example.com/" xmlns:ex="http://example.com"> <Numbers ex:sequence="54321" sequence="12345">One Two Three Four Five</Numbers> </Example> */ if (!extension_loaded('xsl')) { die("Don't forget to enable to xsl extension"); } $xml = new DOMDocument; $xml->load(dirname(__FILE__) . '/bug.xml'); $xsl = new DOMDocument; $xsl->load(dirname(__FILE__) . '/bug.xsl'); $proc = new XSLTProcessor; $proc->importStyleSheet($xsl); // attach the xsl rules print $proc->transformToXML($xml); ?> Expected result: ---------------- ---------- php ---------- <?xml version="1.0"?> I expect to see 54321 54321 One Two Three Four Five after this point 5432154321One Two Three Four Five Output completed (0 sec consumed) - Normal Termination Actual result: -------------- ---------- php ---------- <?xml version="1.0"?> I expect to see 54321 54321 One Two Three Four Five after this point 12345One Two Three Four Five Output completed (0 sec consumed) - Normal Termination