Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Jdom and Xpath Question

807588Apr 17 2009 — edited Apr 17 2009
Good morning all,

I am trying to use xpath to process the result from a webservice call. I have having an issue trying to create a docuemnt so that I can use xpath.

Can anyone tell me what I am doing wrong in the code below? When I run it I get the error "[Document: No DOCTYPE declaration, Root is [Element: <soap:Envelope [Namespace: http://schemas.xmlsoap.org/soap/envelope/]/>]]"

Thanks,
Doug




import java.io.IOException;
import javax.servlet.http.*;
import java.io.StringReader;
import java.lang.String;
import org.jdom.xpath.XPath;
import org.jdom.Document;

...

String temp2 = "<?xml version=\"1.0\"?> <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">  <soap:Body>    <Response xmlns=\"http://integrationuri.org/\">      <Result>testing</Result>    </Response>  </soap:Body></soap:Envelope>";

Document doc = new org.jdom.input.SAXBuilder().build(new StringReader(temp2));

resp.getWriter().println(doc);

...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2009
Added on Apr 17 2009
10 comments
1,034 views