Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6945411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:25:58+00:00 2026-05-27T13:25:58+00:00

I am evaluating the expression ” = 0 in JxPath 1.3, and I expect

  • 0

I am evaluating the expression '' = 0 in JxPath 1.3, and I expect the result to be false. This is my code:

JXPathContext.newContext(ctaSectionABean).getValue("'' = 0");

However, the result returned to be is true! If I evaluate the same expression in Eclipse jxpath tool I get false, which I expect to be correct, since the documentation of xpath1.0 section 3.4 says the following:

When neither object to be compared is a node-set and the operator is =
or !=, then the objects are compared by converting them to a common
type as follows and then comparing them. If at least one object to be
compared is a boolean, then each object to be compared is converted to
a boolean as if by applying the boolean function. Otherwise, if at
least one object to be compared is a number, then each object to be
compared is converted to a number as if by applying the number
function. Otherwise, both objects to be compared are converted to
strings as if by applying the string function. The = comparison will
be true if and only if the objects are equal; the != comparison will
be true if and only if the objects are not equal. Numbers are compared
for equality according to IEEE 754 [IEEE 754]. Two booleans are equal
if either both are true or both are false. Two strings are equal if
and only if they consist of the same sequence of UCS characters.

So, since no object is a boolean and one of them is a number, I expect JxPath to try and convert them both to numbers. That would be 0 for 0 and NaN for '', and I tested that JxPath does convert them that way with the number() function. That means that JxPath does not try to convert them to numbers, as the spec defines.

Is this a bug?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:25:59+00:00Added an answer on May 27, 2026 at 1:25 pm

    Yes, if your information is correct then I think this is a bug.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a program for evaluating postfix-expression code: #include <iostream> #include
I have this code: <asp:CheckBox ID=chkLivrareExterna runat=server OnCheckedChanged=ChkLivrare_CheckedChanged AutoPostBack=true ToolTip=<%= getChkLivrareExternaToolTip() %>/> and the
I'm looking for a succinct expression for evaluating whether or not all the items
From the JavaDoc : returns: The String that is the result of evaluating the
I am evaluating following following expression. And it always evaluates to true even if
When evaluating the expression: *main> [0, 0.1 .. 1] I was actually expecting: [0,
What's the best algorithm for evaluating a mathematical expression? I'd like to be able
This is my error: Error: This expression has type nfa but is here used
When evaluating an expression in a scalar (boolean) context, Perl uses the explicit value
While evaluating the advantages and disadvantages of moving our Subversion-based repository over to Git,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.