Hi Herv�

>  StringReader reader = new StringReader(theXML.toString());
>  InputSource is = new InputSource(reader);
>  DOMParser parser = new DOMParser();
>  parser.parse(is);
>  Document doc = parser.getDocument();

Well, that's strange. Are you sure theXML is properly filled? 

Anyways, here is the code for doing it with pipes:

      PipedReader pr = new PipedReader();
      try
      {
         PipedWriter pw = new PipedWriter(pr);
         theXML.output(pw);
      }
      catch(IOException e){}

      InputSource is = new InputSource(pr);

      try
      {
         pr.close();
      }
      catch(IOException e){}

      DOMParser parser = new SAXParser();
      try
      {
         parser.parse(is);
      }
      catch(IOException e){}


If you use the DOMFactory you'll become a NodeList, so I guess you will have to 
somehow build your document based on that. 


--
------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to