Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Returning a xml document which generated at the run time

Posted on 2002-07-09
3
Medium Priority
?
162 Views
Last Modified: 2013-11-24
I need to recieve a xml file to use in another application, as the XML inputSource to build DOM tree.
So I'm calling to a java servlet using http protocol and that servlet will process the xml file. From that end I can use it as the source.
Pls tell me can this be done? If so pls help with some coding.
0
Comment
Question by:otuwa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 7142681
It can be done. There are some examples of the trickier bits here:
http://www.api4java.net/
0
 
LVL 7

Accepted Solution

by:
Igor Bazarny earned 200 total points
ID: 7146772
Hi,

As I see from the javax.xml.parsers.DocumentBuilder API, you can use InputStream directly. Your code would be (exception handling omitted):

URL servlet = new URL("http://your.servlet.server/servlet/path");

DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();

Document dom = builder.parse(servler.openConnection());

Regards,
Igor Bazarny,
Brainbench MVP for Java 1
0
 
LVL 7

Expert Comment

by:Igor Bazarny
ID: 7189869
Thinks for the poins, but why is grade C? Could you explain why are you not satisfied with answer?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
A solution for Fortify Path Manipulation.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question