Announcement Announcement Module
Collapse
No announcement yet.
XPathExpression vs. XPathOperations Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XPathExpression vs. XPathOperations

    Hi

    I've just started using spring-xml which is part of spring-ws project and I have quickly noticed inconsistencies in these two interfaces:

    Code:
    org.springframework.xml.xpath.XPathOperations
    Code:
    org.springframework.xml.xpath.XPathExpression
    First one allows operations on top of javax.xml.transform.Source, the second one allows only operations on top of org.w3c.dom.Node.

    What I would like to do is to create precompiled XPathExpressions and then evaluate them by passing an instance of Source (in my case org.springframework.xml.transform.ResourceSource).

    I don't think adding methods taking InputSource to XPathExpression should be a problem since javax.xml.xpath.XPathExpression takes both Node and InputSource. Maybe I am overlooking something?

    Also note following inconsistency:
    Code:
    XPathOperations: double evaluateAsDouble(String expression, Source context) throws XPathException
    Code:
    XPathExpression: double evaluateAsNumber(Node node) throws XPathException;
    Thanks.

    Jaro
Working...
X