Hi there!

I'm using commons-jxpath-1.1. Everytime I try to execute

  context.getValue("count(//List/Item)")

I get a java.lang.ClassCastException.

The XML looks like this:

  <?xml version="1.0" encoding="UTF-8"?>
  <List>
    <Item>
      <Name>xyz</Name>
      <Name2>abc</Name>
    </Item>
  </List>

The code looks like this:

  JXPathContext context = JXPathContext.newContext(doc);
  // doc is a JDOM tree
  System.out.print("JXTest: ");
  System.out.println((String)context.getValue("count(//List/Item)"));

(I also tried Integer instead of String.)

Which type of object does the getValue() method return after "count"
has been executed?

Thanks for any hints!
Christian.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to