Questions tagged [jxpath]

JXPath applies XPath expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet contexts, DOM etc, including mixtures thereof.

JXPath is a Java package that enables extraction of data from hierarchical data structures using XPath notation. JXPath can apply XPath expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet contexts, DOM etc, including mixtures thereof.

Example:

Address address = (Address)JXPathContext.newContext(vendor).
         getValue("locations[address/zipCode='90210']/address");

This XPath expression is equivalent to the following Java code:

Address address = null;
Iterator it = vendor.getLocations().iterator();
while (it.hasNext()){
    Location location = (Location)it.next();
    String zipCode = location.getAddress().getZipCode();
    if (zipCode.equals("90210")){
      address = location.getAddress();
      break;
    }
}
50 questions
0
votes
1 answer

How does one implement expensive queries in jxpath?

Imagine that one were using JXPath as an access language into a tree that has certain nodes that represent collections that are impractically large or expensive to hold in memory - e.g., .../customers[id=12345] where the customers are really in a…
Ed Staub
  • 15,480
  • 3
  • 61
  • 91
0
votes
1 answer

Java Enum for jxpath

I have some jxpaths I want to put them in an enumeration I will be sharing with a JSF page using a map that will make them available to EL as the keys for jxpath to do a createPathAndSetValue on. Then I can easily fill out a model without creating…
ggb667
  • 1,881
  • 2
  • 20
  • 44
0
votes
2 answers

how to use text() in jxpath

Can you get the text() of a jxpath element or does it not work? given some nice xml:
ggb667
  • 1,881
  • 2
  • 20
  • 44
0
votes
1 answer

Jibx vs JXPath in terms of performance

Dealing with a project in which huge volumes of XML files are processed and loaded into RDBMS. In the tranformation layer, XML file needs to be converted to java pojo , enriched validated and then inserted into DB. The file size is appx. 10…
Selvakumar Esra
  • 1,154
  • 2
  • 15
  • 30
-1
votes
1 answer

Handling Java Optional in JXPath object hierachy?

I have an object graph and one of the accessor methods returns a java Optional and as a result my XPath expression stops from that point onwards. The xpath is data/someData[1]/optionalObject/field How can I get JXPath to return the actual object…
juckky
  • 493
  • 3
  • 13
1 2 3
4