<html>
Hello,<br>
<br>
I'm getting a "org.w3c.dom.Document" from a database and I need
to convert it to "java.io.InputStream"<br>
so that I can create a "org.jdom.Document" with the method
<font face="Courier New, Courier" color="#0000FF"><b><u>build</font></b></u><font face="Courier New, Courier">(java.io.InputStream
in).<br>
<br>
</font>Is it possible to cast one Document to another?<br>
-------------------------------------------------------------------------------------------------------------------------------------------------------<br>
// returns a org.w3c.dom.Document<br>
domDoc = student.getClassesDOM(conn, "UGRD");<br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><br>
if (doc != null)<br>
{<br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><br>
<x-tab> </x-tab>try {
<br>
<x-tab> </x-tab>// Request
document building without validation <br>
<x-tab> </x-tab><x-tab> </x-tab>org.jdom.input.SAXBuilder
builder = new org.jdom.input.SAXBuilder(false); <br>
<br>
<x-tab> </x-tab><x-tab> </x-tab>org.jdom.Document
jDoc = builder.build(xmlSource);
<x-tab> </x-tab>//This builds a document
from the supplied input stream.<br>
<br>
<br>
<x-tab> </x-tab><x-tab> </x-tab>//
Get the root element <br>
<x-tab> </x-tab><x-tab> </x-tab>org.jdom.Element
root = jDoc.getRootElement(); <br>
<x-tab> </x-tab><x-tab> </x-tab>List
allChildren = root.getChildren(); //return all children<br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><br>
<x-tab> </x-tab>
} catch (Exception ejdom) { <br>
<x-tab> </x-tab><x-tab> </x-tab>
ejdom.printStackTrace(); <br>
<x-tab> </x-tab>
} <br>
<br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><br>
<br>
<div>Sincerely,</div>
<div>David Parker </div>
<br>
<div><a href="mailto:david.parker@doit.wisc.edu" EUDORA=AUTOURL>mailto:david.parker@doit.wisc.edu</a></div>
<div> </div>
<div>Library, Instructional & Retrieval Applications, </div>
<div>DoIT - University of Wisconsin-Madison</div>
<div>1210 West Dayton Street, Madison WI 53706</div>
Phone: 608.265.7829 <x-tab> </x-tab>FAX:
608.265-6453
</html>