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/11/14 23:58:30 UTC

DO NOT REPLY [Bug 4876] New: - xsltc has problem with namespace-alias (namespace113)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4876>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

xsltc has problem with namespace-alias (namespace113)

           Summary: xsltc has problem with namespace-alias (namespace113)
           Product: XalanJ2
           Version: CurrentCVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: tom.amiro@sun.com


This problem here is different from the case where XSLTC 
didn't agree with the expected prefix, but did have the correct 
associated URI -- which was deemed not a bug. conf test namespace113
is another variation on the theme of creating a styleheet as 
output and having to get around the problem of being able 
to use literal result elements in the first stylesheet to 
generate xsl elements in the output. Test namespace113 does have the 
additional complication of using an imported stylesheet, but I 
don't think that is central to the problem.

Here's a comparison of xslt and xalan output:

Running xalan on namespace113
<?xml version="1.0" encoding="UTF-8"?>
<ixsl:stylesheet xmlns:ixsl="http://www.w3.org/1999/XSL/Transform"
                             version="1.0">
  <ixsl:template match="foo"><ixsl:text>Recognized
foo</ixsl:text></ixsl:template>
  <ixsl:template match="bar"><ixsl:text>Recognized
bar</ixsl:text></ixsl:template>
</ixsl:stylesheet>

Running XSLTC with Xerces Parser on namespace113
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="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>
  <xsl:template match="bar"><xsl:text>Recognized bar</xsl:text></xsl:template>
</xsl:stylesheet>

Besides the confusing mixing of xsl and ixsl prefixes in the XSLTC output,
the ns declaration xmlns:ixsl="http://www.w3.org/1999/XSL/TransformAlias" 
looks plain wrong, and would make the resulting stylesheet invalid.

namespace113.xsl
----------------
namespace113.xsl
<?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">

<!-- FileName: namespace113 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 7.1.1 Literal Result Elements -->
<!-- Creator: Gary L Peskin, based on test case from Jens Lautenbacher -->
<!-- Purpose: Verify that namespace-alias is honored in included stylesheets.
-->

   <xsl:include href="incnamespace113.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> 

incnamespace113.xsl
-------------------
<?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">

<!-- FileName: incnamespace113 -->
<!-- Purpose: Included stylesheet for test case namespace113. -->

<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>