491339 messages in 933 lists

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/
Message Thread
An invalid XML character (Unicode: 0x1c) James Mao (james.mao@iona...)
01 Dec 2007
Re: [jaxen-user] An invalid XML character (Unicode: 0x1c) Elliotte Rusty Harold (elharo@metalab.unc...)
01 Dec 2007
Re: [jaxen-user] An invalid XML character (Unicode: 0x1c) James Mao (james.mao@iona...)
01 Dec 2007
Re: [jaxen-user] An invalid XML character (Unicode: 0x1c) Tatu Saloranta (cowtowncoder@yahoo...)
01 Dec 2007
Re: [jaxen-user] An invalid XML character (Unicode: 0x1c) James Mao (james.mao@iona...)
03 Dec 2007
Copyright 2006-2008 The Codehaus Foundation
Powered by Codehaus March (Version: 0.1-HEAD)