The XML parser in use is complaining about whitespace or characters
appearing before the <?xml version="1.0"?> statement.  I just ran the
example on my OS X 10.4 machine and did not have trouble, though I'm
using Eclipse and not Xcode.

Can you insert something like

  response.getEntity().write(System.out);

to spot anything wrong with the XML you are getting from Yahoo (or
whatever server you are hitting, if you've changed the example to be
a client of something else?)

- Rob


----- Original Message ----- 
From: "Aadjan van der Helm" <[EMAIL PROTECTED]> 
To: [email protected] 
Sent: Thursday, September 27, 2007 4:23:56 PM (GMT-0500) America/New_York 
Subject: Trying to run book example2_1a 

Dear list, 

I'm evaluating the restlet framework to see if we can use it to create 
clients for our restful image server. 

It's been a while since I was actively coding in java and it took a 
while to get an xcode project (I'm on osx 10.4.10) into a shape to get 
the book examples to compile and run. 

Now I've worked that out up to a point that eg. example 2_1a compiles 
but generates a runtime error: 
[Fatal Error] :1:1: Content is not allowed in prolog. 

It dies in the loop to iterate over the requested items in the document. 
// Use XPath to find the interesting parts of the data structure 
String expr = "/ResultSet/Result/Title"; 
for (Node node : document.getNodes(expr)) { 
System.out.println(node.getTextContent()); 
} 

Any clues what is going wrong? 

Thanks in advance, 
--Aadjan 

Run log: 
[Session started at 2007-09-27 22:08:45 +0200.] 
Sep 27, 2007 10:08:47 PM com.noelios.restlet.http.StreamClientHelper start 
INFO: Starting the HTTP client 
[Fatal Error] :1:1: Content is not allowed in prolog. 
Exception in thread "main" java.lang.NullPointerException 
at Example2_1a.main(Example2_1a.java:46) 

java has exited with status 1. 

Reply via email to