开发者

oracle xml parser error when upgrading from jdk 1.4 to jdk 1.5

开发者 https://www.devze.com 2023-03-20 02:15 出处:网络
I am trying to 开发者_运维技巧upgrade some legacy code (which uses JDK 1.4) to compile with JDK 1.5. The code uses the Oracle XML parser.

I am trying to 开发者_运维技巧upgrade some legacy code (which uses JDK 1.4) to compile with JDK 1.5. The code uses the Oracle XML parser.

The old code(with JDK 1.4) uses xmlparserv2.jar/xschema.jar from Oracle 10g release.

For the upgrade (JDK 1.5 version), I am using the xmlparserv2.jar/xschema.jar from Oracle 11.2 release.

import oracle.xml.parser.v2.XMLNode;

private static String getString(Node node, String xpath) throws XSLException
{
   try {
       return ((XMLNode) node).valueOf(xpath);
   }
   catch (...) {
   }
}

A sample xpath passed into the getString function above has the form boolean(/some/path/text()).

With JDK 1.5 and the jar file from Oracle 11.2, I am getting an error which says:

oracle.xml.xpath.XPathException: Cannot convert boolean to NodeSet.

0

精彩评论

暂无评论...
验证码 换一张
取 消