: (diff > 0.0) ? (k.m_descending ? -1 : 1) : 0);
}
} // end treat as numbers
else
{
CollationKey n1String, n2String;
if (kIndex == 0)
{
n1String = (CollationKey) n1.m_key1Value;
n2String = (CollationKey) n2.m_key1Value;
}
else if (kIndex == 1)
{
n1String = (CollationKey) n1.m_key2Value;
n2String = (CollationKey) n2.m_key2Value;
}
/* Leave this in case we decide to use an array later
if (kIndex < maxkey)
{
String n1String = (String)n1.m_keyValue[kIndex];
String n2String = (String)n2.m_keyValue[kIndex];
}*/
else
{
// Get values dynamically
XObject r1 = k.m_selectPat.execute(m_execContext, n1.m_node,
k.m_namespaceContext);
XObject r2 = k.m_selectPat.execute(m_execContext, n2.m_node,
k.m_namespaceContext);
n1String = k.m_col.getCollationKey(r1.str());
n2String = k.m_col.getCollationKey(r2.str());
}
// Use collation keys for faster compare, but note that whitespaces
// etc... are treated differently from if we were comparing Strings.
result = n1String.compareTo(n2String);
//Process caseOrder parameter
if (k.m_caseOrderUpper)
{
String tempN1 = n1String.getSourceString().toLowerCase();
String tempN2 = n2String.getSourceString().toLowerCase();
if (tempN1.equals(tempN2))
{