[jdom-interest] Getting String from a Document

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Jun 15 19:53:41 PDT 2000


I'm not sure what I'm missing here but I see these two methods in 
org.jdom.input.SAXBuilder:

public Document build(java.io.Reader characterStream)
                throws JDOMException

       This builds a document from the supplied Reader.

       Parameters:
             in - Reader to read from.
       Returns:
             Document - resultant Document object.
       Throws:
             JDOMException - when errors occur in parsing.


public Document build(java.io.Reader characterStream,
                       java.lang.String SystemId)
                throws JDOMException


I see that the JavaDoc is a little off from the actual arguments. 
characterStream should be changed to in as the JavaDoc suggests (I 
really don't like calling Readers character streams, gives people the 
wrong ideas about what's a subclass of what) but either of these two 
methods should do what you need.


+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list