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 2002/03/01 20:47:01 UTC

DO NOT REPLY [Bug 6798] New: - xsl:number returns incorrect value when namespace is present

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=6798>.
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=6798

xsl:number returns incorrect value when namespace is present

           Summary: xsl:number returns incorrect value when namespace is
                    present
           Product: XalanJ2
           Version: 2.0.0
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.transformer
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: smith_robert_p@yahoo.com


I am trying to write an XSL that processes an XHTML
page. I need to keep track of how many paragraphs
there are. When I use Xalan to do the XSLT I get a
different result from when I use MSXML or Saxon to do
the processing. I believe that the other two processors
are behaving according to spec and Xalan is in error.

If I remove the xmlns from this example then Xalan works
as expected.

My XHTML source is:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>My Example</title>
    </head>
    <body>
        <p>This is the first line.</p>
        <p>And this is the second line.</p>
    </body>
</html>

My XSL is:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
        <output>
            <xsl:apply-templates select="//xhtml:p"/>
        </output>
    </xsl:template>
    <xsl:template match="xhtml:p">
        <value>
            <xsl:number/>
        </value>
    </xsl:template>
</xsl:stylesheet>

When I use Xalan (Java version 2) the output is:
<?xml version="1.0" encoding="UTF-8"?>
<output xmlns:xhtml="http://www.w3.org/1999/xhtml">
<value/>
<value/>
</output>

When I use MSXML 3.0 or Saxon 6.5.1 I get:
<?xml version="1.0" encoding="utf-8"?>
<output xmlns:xhtml="http://www.w3.org/1999/xhtml">
   <value>1</value>
   <value>2</value>
</output>