http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2535

*** shadow/2535 Tue Jul 10 06:15:20 2001
--- shadow/2535.tmp.23980       Tue Jul 10 06:15:21 2001
***************
*** 0 ****
--- 1,94 ----
+ +============================================================================+
+ | xsltc fails attribset24, outputting a double ns prefix                     |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2535                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.0                   |
+ |   Resolution:                            Platform: Sun                     |
+ |     Severity: Normal                   OS/Version: Solaris                 |
+ |     Priority: Other                     Component: org.apache.xalan.xsltc  |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                     |
+ |  Reported By: [EMAIL PROTECTED]                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ XSLTC fails conformance test attribset24.
+ 
+ XSL File
+ ======== 
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
+             xmlns:bdd="http://bdd.test.com";>
+   <!-- FileName: attribset24 -->
+   <!-- Document: http://www.w3.org/TR/xslt -->
+   <!-- DocVersion: 19991116 -->
+   <!-- Section: 7.1.3 Creating Attributes -->
+   <!-- Creator: Paul Dick -->
+   <!-- Purpose: The attribute must be in the designated namespace, 
+        even if the prefix has to be reset or ignored. -->
+ <xsl:template match="/">
+   <out>
+     <jam>
+       <xsl:attribute name="{docs/b}"
+ namespace="http://xyz.com";>jaminben</xsl:attribute>
+     </jam>
+   </out>
+ </xsl:template>
+ </xsl:stylesheet>
+ 
+ XML File
+ ========
+ <?xml version="1.0"?>
+ <docs>
+   <b>bdd:attr</b>
+ 
+ Obtained Output from XSLTC
+ ==========================
+ 
+ <?xml version="1.0" encoding="utf-8" ?>
+ <out xmlns:bdd="http://bdd.test.com";><jam xmlns:ns0="http://xyz.com";
+ ns0:bdd:attr="jaminben"/></out>
+ 
+ Obtained Output from Other XSLT Processors
+ ==========================================
+ xt 
+ --
+ <?xml version="1.0" encoding="utf-8"?>
+ <out xmlns:bdd="http://bdd.test.com";><jam ns0:attr="jaminben"
+ xmlns:ns0="http://xyz.com"/></out>
+ 
+ saxon
+ -----
+ saxon attribset24.xml attribset24.xsl
+ <?xml version="1.0" encoding="utf-8"?><out xmlns:bdd="http://bdd.test.com";><jam
+ xmlns:bdd="http://xyz.com"; bdd:attr="jaminben"/></out> glrr 183 =>
+ 
+ xalan
+ -----
+ xalan attribset24.xml attribset24.xsl
+ <?xml version="1.0" encoding="UTF-8"?>
+ <out xmlns:bdd="http://bdd.test.com";><jam xmlns:bdd="http://xyz.com";
+ bdd:attr="jaminben"/></out>
+ 
+ Analysis
+ ========
+ The name of the attribute being created is "bdd:attr". The namespace
+ for prefix "bdd" is set to "http://bdd.test.com"; at the stylesheet level,
+ but it should be over-ridden by the namespace attribute of the
+ <xsl:attribute...> element, which specifies the url of "http://xyz.com";. 
+ Therefore, as the author of the test says "the attribute must be in the
+ designated namespace [http://xyx.com] even if the prefix [bdd] has to be reset
+ or ignored."
+ 
+ XT changes the prefix from "bdd" to "ns0" and associates "ns0" with
+ "http://xyx.com";.
+ 
+ Saxon and Xalan effectively reset the bdd prefix within the created element to
+ force it's "bdd:attr" attribute to be in the designated namespace.
+ 
+ XSLTC starts off like XT associating a generated prefix "ns0" with the
+ designated namespace, but then does something strange: prepends it to 
+ the attribute name "bdd.attr", thus giving 
+ 
+     ns0:bdd:attr

Reply via email to