You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/03/16 16:42:20 UTC

[Bug 994] New - xsl:included stylesheets don't honor xsl:namespace-alias

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

*** shadow/994	Fri Mar 16 07:42:20 2001
--- shadow/994.tmp.23327	Fri Mar 16 07:42:20 2001
***************
*** 0 ****
--- 1,87 ----
+ +============================================================================+
+ | xsl:included stylesheets don't honor xsl:namespace-alias                   |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 994                         Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.0                   |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Critical                 OS/Version: Linux                   |
+ |     Priority:                           Component: Xalan                   |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xalan-dev@xml.apache.org                                     |
+ |  Reported By: jtl@schlund.de                                               |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ when I have a xsl:namespace-alias definition in my stylesheet, other stylesheets
+ inluded via xsl:include don't change their result namespace accordingly
+ 
+ A stripped down example:
+ 
+ *** XML input:
+ 
+ <source>
+   <gen_a name="foo"/>
+   <gen_b name="bar"/>
+ </source>
+ 
+ *** The main xsl file:
+ 
+ <?xml version="1.0" encoding="ISO-8859-1"?>
+ <xsl:stylesheet version="1.0"
+                 xmlns:ixsl="http://www.w3.org/1999/XSL/TransformAlias"
+                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ 
+   <xsl:include href="gen_a.xsl"/>
+   <xsl:namespace-alias stylesheet-prefix="ixsl" result-prefix="xsl"/>
+   
+   <xsl:template match="/"> 
+     <ixsl:stylesheet version="1.0">
+       <xsl:apply-templates/>
+     </ixsl:stylesheet>
+   </xsl:template>
+   
+   <xsl:template match="gen_b">
+     <ixsl:template>
+       <xsl:attribute name="match"><xsl:value-of select="@name"/></xsl:attribute>
+       <ixsl:text>Recognized <xsl:value-of select="@name"/></ixsl:text>
+     </ixsl:template>
+   </xsl:template>
+   
+ </xsl:stylesheet>
+ 
+ *** The included stylesheet: (NOTE that gen_a does exactly the same what gen_b does)
+ 
+ <?xml version="1.0" encoding="ISO-8859-1"?>
+ <xsl:stylesheet version="1.0"
+                 xmlns:ixsl="http://www.w3.org/1999/XSL/TransformAlias"
+                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ 
+   <xsl:template match="gen_a">
+     <ixsl:template>
+       <xsl:attribute name="match"><xsl:value-of select="@name"/></xsl:attribute>
+       <ixsl:text>Recognized <xsl:value-of select="@name"/></ixsl:text>
+     </ixsl:template>
+   </xsl:template>
+   
+ </xsl:stylesheet>
+ 
+ *** and the result:
+ 
+ <?xml version="1.0" encoding="UTF-8"?>
+ <ixsl:stylesheet xmlns:ixsl="http://www.w3.org/1999/XSL/Transform"           
+                  version="1.0">
+ 
+   <ixsl:template xmlns:ixsl="http://www.w3.org/1999/XSL/TransformAlias match="foo">
+     <ixsl:text>Recognized foo</ixsl:text>
+   </ixsl:template>
+   
+   <ixsl:template match="bar">
+     <ixsl:text>Recognized bar</ixsl:text>
+   </ixsl:template>
+ </ixsl:stylesheet>
+ 
+ Note the wrong namespace in the <template match="foo"> case!
+ 
+ This example workes with xalan1 of course.