#1384: _common.xsl copies namespace declarations without prefix
--------------------+-------------------------------------------------------
 Reporter:  david   |       Owner:  david
     Type:  defect  |      Status:  new  
 Priority:  normal  |   Milestone:  1.0.5
Component:  config  |     Version:  1.0.4
 Severity:  minor   |    Keywords:       
Has_patch:  0       |  
--------------------+-------------------------------------------------------
 In {{{_common-migrate-element}}}, {{{_common.xsl}}} copies all nodes on
 the namespace axis except the one that has the same namespace URI as the
 current element.

 That does, however, also copy over a plain {{{xmlns}}} declaration from
 another namespace, which in some cases can lead to weird results, such as
 this one I came across whilst working on config handlers for
 milestone:1.1, where this:
 {{{
 #!xml
 <?xml version="1.0" encoding="UTF-8"?>
 <ae:configurations
 xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0";
 xmlns="http://agavi.org/agavi/config/parts/config_handlers/1.0";>
         <ae:configuration>
                 <handlers>
 }}}
 is converted to:
 {{{
 #!xml
 <?xml version="1.0" encoding="UTF-8"?>
 <configurations xmlns="http://agavi.org/agavi/config/global/envelope/1.1";
 xmlns:default="http://agavi.org/agavi/config/parts/config_handlers/1.1"; >
         <default:configuration
 xmlns="http://agavi.org/agavi/config/parts/config_handlers/1.1";>
                 <default:handlers>
 }}}

 The {{{<configuration>}}} element here ends up in the content namespace
 since the XSLT processor seems to shuffle namespace prefixes around a bit,
 and our copying of the {{{xmlns}}} attribute gets in the way.

 The purpose of copying {{{xmlns:foo}}} declarations is to make sure that
 they remain available as originally declared, which usually is only
 relevant in cases where element or attribute content refers to the
 declared prefixes again, think {{{<xs:element type="foo:burp" />}}}. We
 need that mainly for SOAP, WSDL and stuff like that.

 As a fix, we can simply suppress the copying of an {{{xmlns}}} attribute,
 since that's useless anyway.

-- 
Ticket URL: <http://trac.agavi.org/ticket/1384>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5



_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets

Reply via email to