<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2462.0" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=223373715-19062001><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial size=2>I've browsed the
archives to find a solution for this problem : I need to validate a
org.w3c.dom.Document (against DTD or Schema which is in a jar file) and convert
this to org.jdom.Document.</FONT></SPAN></DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial size=2>I've found that I
have to use EntityResolver (the schema is in a jar file) and so a SAXBuilder. So
I need to create a InputStream with a org.w3c.dom.Document. In order to complete
this I convert the document to string with this :</FONT></SPAN></DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial size=2>public String
DOMToString(org.w3c.dom.Document doc) </FONT></SPAN><SPAN
class=223373715-19062001><FONT face=Arial
size=2>{<BR>
OutputFormat format = new OutputFormat( doc
); //Serialize
DOM<BR>
StringWriter stringOut = new
StringWriter(); //Writer will be a
String<BR>
XMLSerializer serial = new XMLSerializer( stringOut, format
);<BR>
serial.asDOMSerializer();
// As a DOM
Serializer<BR>
serial.serialize( doc.getDocumentElement()
);<BR> return
stringOut.toString() ;</FONT></SPAN></DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial size=2>And then use a
StringReader. It seems to be a little bit complicated (but DOM & SAX
are complicated ;-) ), so is it the right way to complete this task
?</FONT></SPAN></DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial size=2>Thanks in
advance.</FONT></SPAN></DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223373715-19062001><FONT face=Arial
size=2>-Eric</FONT></SPAN></DIV></BODY></HTML>