Thx Fabian for your clue.

Here, I work with local variables for both XML content and XPath value. I can 
print both variable content, even after trying to use the getNode() method...

So maybe the truth is out there...


> Hello, the post did come twice :-)
> 
> It's possible that if you print stuff (read: use the stream) from the
> representation you get in the request body, for example for debug
> purposes, you'll loose the representation itself (you've already
> consumed it), so any method accessing it may return null.
> 
> It's a bit harder to debug streamed representations, but you have to
> make sure you got all the stream, saved or parsed it somewhere, and
> only then try to debug it.
> 
> Hope this helps.
> 
> On Wed, Dec 29, 2010 at 6:41 AM, Vidrequin <cedric dot vidrequin at gmail dot 
> com> wrote:
> > Hi all,
> >
> > this is the first time I post on the mailing list so please apologies if 
> > some informations are missing: just ask for them and I'll give you them 
> > with pleasure :)
> >
> > ( I also hope I didn't post this message twice -_- )
> >
> > I wrote this simple sample of code that should work fine:
> >
> > import org.restlet.ext.xml.DomRepresentation;
> > DomRepresentation domRep = new DomRepresentation(MediaType.APPLICATION_XML, 
> > doc.getDom());
> > refNode = domRep.getNode(refnode);
> >
> > Here, doc.getDom() is a valid XML Document (org.w3c.dom.Document) : I print 
> > the content of the document as a String (in the console) and the content is 
> > ok.
> > I also use the org.restlet.data.MediaType.
> >
> > I try to search for the following xpath : 
> > "/section/section/section/para/text()" but it fails : the method getNode() 
> > returns null.
> > I checked the content of the XML and the path exists.
> >
> > I tried with simpler xpath, like "/section" but it returns null too.
> > When I print the result of getNode("/*"), it shows "[section: null]".
> > When I print the result of getNode("/"), it shows "[#document: null]".
> >
> > Does any one know what is the reason of this problem ? or what could I do 
> > to solve it ?
> > Do you need more informations ?
> >
> > Thanks in advance for helping.
> >
> > ------------------------------------------------------
> > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694560
> >
> 
> 
> 
> -- 
> Fabián Mandelbaum
> IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694977

Reply via email to