Solved

Returning a xml document which generated at the run time

Posted on 2002-07-09
3
158 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 100 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java mysql insert application 14 64
Java 8 to Java 6 8 41
passing enum to a method 4 46
Java List 4 70
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

742 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