commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Mewett <dmew...@VALINF.COM>
Subject [JXPath] Possible bug
Date Wed, 29 Sep 2004 09:24:37 GMT
Hi All,

 

I have been doing some testing on iterating Pointers using the
iteratePointers() method of the JXPathContext class.  I have found the
following potential bug.  If I have a simple bean like this:

 

public class SimpleBean {

 

  private int someIntValue;

  private String someStringValue;

 

  ...... getters and setters for properties.....          

 

}

 

If I create a JXPath context on an instance of this class with some sample
data in each of the properties and execute this:

 

 Iterator ity = context.iteratePointer("//*");

 

  while (ity.hasNext()) {

            NodePointer pointer = (NodePointer) ity.next();

            System.out.println("Node Type:"
pointer.getNode().getClass().getName());

            System.out.println("Node XPath:" pointer.asPath());

} 

 

The output I get is 

 

   Node Type:    java.lang.Integer 

   Node XPath:  /someStringValue

   

   Node Type:  java.lang.String

   Node XPath: /someStringValue

 

.........

 

As can be seen the XPath for the first property is incorrect it should be
/someIntValue

 

Am I doing something wrong?  

 

I am trying to get a list of all possible XPaths in an object, is there a
better way to do this?

 

Thanks for your help.

 

Dan

 

   


****************************************************************************
DISCLAIMER:

The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorised. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.

Thank you.

Valid Information Systems Limited. Address: Morline House, 160 London Road,
Barking, Essex, IG11 8BB. 

http://www.valinf.com Tel: +44 (0) 20 8215 1414 Fax: +44 (0) 20 8215 2040

Please note that as part of our drive to continually improve the service to
our clients, we have established a dedicated support line for customers to 
call if they are in need of help with their installation of R/KYV or have a
query regarding the operation of the software. The number is - 0870 0161414
This will ensure any call is carefully noted, any action required is 
scheduled for completion and any problem experienced handled by a carefully
chosen team of developers. Please make a note of this number and pass it 
on to any other relevant person within your organisation.
 
*****************************************************************************

------------------------------------------------------------------------------------------------------
Join us at Summit 2005 - Celebrating Success
Hummingbird Worldwide Conference & Technology Showcase
February 7-9, 2005
The Loews Miami Beach Hotel
Miami Beach, Florida

Visit our Web Site: www.hummingbird.com/summit for more information

------------------------------------------------------------------------------------------------------

#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by NetIQ MailMarshal
#####################################################################################

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message