Carsten Schlipf
2007-08-15 19:25:37 UTC
Hello,
on the JXPath user's guide I have read that the axes "parent::" and
"ancestor::" may be used. However in my code I get JXPathExceptions:
JXPathContext context = JXPathContext.newContext(object);
context.getValue("ancestor::");
The call to getValue(String) throws the JXPathException with the
following message:
Invalid XPath: 'ancestor::'. Syntax error after: 'a'.
A similar exception is thrown for 'descendant::' and 'parent::'. Am I
missing something? Do I have to set a special mode or register the
DescendantContext, AncestorContext and ParentContext classes as
functions somehow? I tried the later but didn't succeed.
Thank you very much for help!
Carsten
on the JXPath user's guide I have read that the axes "parent::" and
"ancestor::" may be used. However in my code I get JXPathExceptions:
JXPathContext context = JXPathContext.newContext(object);
context.getValue("ancestor::");
The call to getValue(String) throws the JXPathException with the
following message:
Invalid XPath: 'ancestor::'. Syntax error after: 'a'.
A similar exception is thrown for 'descendant::' and 'parent::'. Am I
missing something? Do I have to set a special mode or register the
DescendantContext, AncestorContext and ParentContext classes as
functions somehow? I tried the later but didn't succeed.
Thank you very much for help!
Carsten