English 中文(简体)
努力减少javax.xml.xpath.XPathExpression.evaluate(目标项目)保证它不会在所有执行过程中失去回报?
原标题:String javax.xml.xpath.XPathExpression.evaluate(Object item) guarantees it never returns null in all implementations?

http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/xpath/XPathExpression.html#evaluate (java.lang.Object)"rel=“nofollow noreferer” 这一努力是评价表达结果和将结果转化为优势的结果。

/**
 * ...
 * ...
 * @return The <code>String</code> that is the result of evaluating the expression and converting the result to a 
 *   <code>String</code>.
 * ...
 * ...
 */
String javax.xml.xpath.XPathExpression.evaluate(Object item)

问题是,如果该表述没有发现的话,那是一点 v。 在所有执行过程中,是否无效? A. 回归情况 ?

最佳回答

如果我正确记住,在XPath就没有这样的东西。 我的猜测是,它将恢复空洞。

XPath 2.0rel=“nofollow noreferer”>XPath 2.0 Functionsspecs证实了这一感觉。

问题回答

这不是一个预期的答案。

<types>
    <type id="1">
        <href>aaa</href>
    </type>
</types>

请允许我说,你写了一个方法:@id,href

Double findIdByHref(final String href) {
    evaluate("/:types/:type[:href= bbb ]/@id", NUMBER);
}

0 notnull> a. 婴儿

final Double id = findByHref("bbb"); // not null

我不得不作这样的修改。

Double findIdByHref(final String href) {
    final Node node = evaluate("/:types/:type[:href= bbb ]", NODE);
    if (node == null) {
        return null;
    }
    return evaluate("@id", node);
}




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签