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

Incorrect eval of XPATH expression involving less than and greater than operators

           Summary: Incorrect eval of XPATH expression involving less than
                    and greater than operators
           Product: XalanJ2
           Version: 2.4Dx
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


For example <xsl:value-of select="count(//target[@id>='1'])"/> 
returns zero when run thru XSLTC it returns zero in all cases I have tried.

build.xml creates two files correct.html via interpreted XSLT and 
incorrect.html via XSLTC. The build file is used as input.

<!-- begin build.xml -->
<project name="xsltcbug" default="main" basedir="D:\donert\xml\xsltc bug">

<!-- ==================== Initialization properties ===================== -->
<property name="xalan" value="d:\java\xalan-j_2_4_D1\bin"/>

<target name="xslt" depends="" id="1">
        <style
                in="build.xml"
                style="bug.xsl"
                out="correct.html" >
        </style>
</target> 

<target name="xsltc" depends="compile,transform"  id="2"/>

<target name="compile" depends=""  id="3">
        <java classname="org.apache.xalan.xsltc.cmdline.Compile" 
           failonerror="true"
           fork="true"
        >
                <jvmarg value="-Xbootclasspath/a:${xalan}\xsltc.jar"/> 
                <arg line="-o bug bug.xsl"/> 
                <classpath>
                        <pathelement path="${java.class.path}"/>
                        <pathelement location="${xalan}\xsltc.jar"/>
                        <pathelement location="${xalan}\BCEL.jar"/>
                        <pathelement location="${xalan}\runtime.jar"/>
                        <pathelement location="${xalan}\JLex"/>
                        <pathelement location="${xalan}\java_cup.jar"/>
                        <pathelement location="${xalan}\regexp.jar"/>
                </classpath>
       </java>
</target>

<target name="transform" depends=""  id="4">
        <java classname="org.apache.xalan.xsltc.cmdline.Transform" 
           failonerror="true"
           fork="true"
           output="incorrect.html"
        >
                <jvmarg value="-Xbootclasspath/a:${xalan}\xsltc.jar"/> 
                <arg line="build.xml bug "/> 
                <classpath>
                        <pathelement path="${java.class.path}"/>
                        <pathelement location="${xalan}\xsltc.jar"/>
                        <pathelement location="${xalan}\runtime.jar"/>
                </classpath>
        </java>
</target>

<target name="main" depends="xslt,xsltc"  id="5"/>

</project>
<!-- end build.xml -->

<!-- begin bug.xsl -->
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        version="1.0">
        
<xsl:template match="/">
        <html><head>
        <title>xsltc Bug Demo</title>
        </head>
        <body>
        <ul>
        <li><a href="correct.html">Correct</a></li>
        <li><a href="incorrect.html">Incorrect</a></li>
        </ul>
        <h1>A few correct results</h1>
        <p>This should be 1 : 
        <xsl:value-of select="count(//target[@id='1'])"/> 
        </p>
        <p>This should be 4 : 
        <xsl:value-of select="count(//target[@id!='1'])"/> 
        </p>

        <h1>A few incorrect results when compiled with xsltc</h1>
        <p>This should be 5 : 
        <xsl:value-of select="count(//target[@id>='1'])"/> 
        </p>
        <p>This should be 4 : 
        <xsl:value-of select="count(//target[@id&lt;'5'])"/> 
        </p>
        </body>
        </html>
</xsl:template>
         
</xsl:stylesheet>
<!-- end bug.xsl -->

Reply via email to