After investigating the source code, I was able to resolve a bug in Xalan-C:
for the xsl IF element below, a doCollationCompare should have been spawned on the two
strings, but only a doCompare was spawned. My quick fix simply calls doCollationCompare
all the time.
 
Cheers,
Markus Latzel
 
CVR York University, Toronto
 
 
I changed PlatformSupport/DOMStringHelper.cpp:
 ------------- SNIP ----------------------------------------------------------------------
 
template <class Type, class SizeType, class FunctionType>
int
doCompare(
                        const Type*             theLHS,
                        SizeType                theLHSLength,
                        const Type*             theRHS,
                        SizeType                theRHSLength,
                        FunctionType    theTransformFunction)
{
 
/* QUICK FIX */

return doCollationCompare(theLHS, theLHSLength, theRHS, theRHSLength, theTransformFunction);
 
        // We don't really have to order, so save some time...
        if (theLHSLength < theRHSLength)
        {
                return -1;
        }
        else if (theRHSLength < theLHSLength)
        {
                return 1;
        }
        else
        {
                Type    theLHSChar = Type(0);
                Type    theRHSChar = Type(0);
 
                for(SizeType i = 0; i < theLHSLength; i++)
                {
                        theLHSChar = theTransformFunction(theLHS[i]);
                        theRHSChar = theTransformFunction(theRHS[i]);
 
                        if (theLHSChar != theRHSChar)
                        {
                                break;
                        }
                }
 
                return int(theLHSChar - theRHSChar);
        }
 
}
 
 
----- Original Message -----
Sent: Wednesday, October 24, 2001 4:14 PM
Subject: bug in xalan-C 1.2: string compare

Hello!
 
I am trying to install Xalan-C on a Linux RedHat platform and get weird behaviour
of the supplied binaries. testXSLT does not translate the string compare functionality
correctly, i.e.
 
<xsl:if test="$a >= $b">
  do something...
</xsl:if>
 
seems to return ALWAYS true, no matter which strings are contained in $a or $b.
 
Trying to rebuild Xalan, my compiler always _hangs_ on the file
XMLSupport/FormatterToHTML.cpp.
 
I am using gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81).
 
Can anybody help?
 
Thanks,
Markus
 

Reply via email to