James Mao wrote:
> Hi,
>
> When evaluate the xpath with jaxen, I got the following error,
>
>
> [java] [Fatal Error] :42:19: An invalid XML character (Unicode:
> 0x1c) was found in the element content of the document.
> [java] Error:
> http://blog.sina.com.cn/sns/service.php?m=feeds&uid=1440138761
> [java] java.lang.NullPointerException
> [java] at
> org.jaxen.dom.DocumentNavigator.getDocumentNode(DocumentNavigator.java:445)
> [java] at
> org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:102)
>
> [java] at
> org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
> [java] at
> org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:680)
> [java] at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:219)
>
>
> I'm using jaxen 1.1.1 with jdk 6
>
> Is it means that I have to filter all the invalid chars, before using
> the jaxen?
>
You have to correct your XML. It seems very likely that the problem is
in the XML itself. The exceptions you report indicate that it's really
the DOM parser complaining, not Jaxen. Jaxen can't query what DOM can't
build. :-(
--
Elliotte Rusty Harold elharo@metalab.unc...
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/