This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
An XML document can't consist of only text. It has to have a root element. That's why it's "not working", as you put it. Now if you went to the root element of the document and tried to set its content to some text, that probably wouldn't throw any exceptions.
Joined: Aug 30, 2005
So then is there any simple way in the java document api way to go from raw text (a String) to a Document object without a file name ?