tags:

views:

114

answers:

0

This is a question to Restlet team. I am building/running example\book\rest\ch2\Example2_1a using Restlet-1.1 distribution. The Example2_1a is Restlet equivalent of O'Reilly "RESTfull Web Services" book's Example2-1.

I added xercesImpl.jar and xalan.jar to runtime classpath. When I pass term=jellyfish as page 24 of the book suggests to the suggested in Example2_1a.java URI: final String uri = BASE_URI + "?appid=restbook&query=" + term; than at runtime I am getting: [java] [Fatal Error] :4:111: The reference to entity "query" must end with the ';' delimiter.

This tells me that XML parser doesn't like & char in the uri. I've escaped it with & as follows: final String uri = BASE_URI + "?appid=restbook&query=" + term;

This time there is no runtime errors, but document.getNodes(expr) returns an empty NodeSet on expr="/ResultSet/Result/Title"; This is wrong, because http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=restbook&query=jellyfish shows that it should return on this XPath: Jellyfish - Wikipedia, the free encyclopedia

Can anyone from the Restler team can clarify what's wrong with this example?

Regards, Vitaly