<br><font size=2 face="sans-serif">Neil,</font>
<br>
<br><font size=2 face="sans-serif">The processing instructions are always
retained. I guess you must be doing something to suppress their output.
Here is an example that outputs just fine, as shown below.</font>
<br>
<br>
<br><font size=2 face="sans-serif">import java.io.StringReader;</font>
<br><font size=2 face="sans-serif">import org.jdom.Document;</font>
<br><font size=2 face="sans-serif">import org.jdom.input.SAXBuilder;</font>
<br><font size=2 face="sans-serif">import org.jdom.output.XMLOutputter;</font>
<br>
<br><font size=2 face="sans-serif">public class OutputTest {</font>
<br><font size=2 face="sans-serif"> </font>
<br><font size=2 face="sans-serif"> public void parse(String
xml) throws Exception {</font>
<br><font size=2 face="sans-serif"> StringReader
r = new StringReader(xml);</font>
<br><font size=2 face="sans-serif"> SAXBuilder
b = new SAXBuilder();</font>
<br><font size=2 face="sans-serif"> Document
d = b.build(r);</font>
<br><font size=2 face="sans-serif"> XMLOutputter
o = new XMLOutputter(" ",true);</font>
<br><font size=2 face="sans-serif"> o.output(d,System.out);
</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"> public static void main(String[]
args) {</font>
<br><font size=2 face="sans-serif"> OutputTest
ot = new OutputTest();</font>
<br><font size=2 face="sans-serif"> try {</font>
<br><font size=2 face="sans-serif">
ot.parse("<?xml version=\"1.0\" encoding=\"UTF-8\"
?><Test><value>3</value></Test>");</font>
<br><font size=2 face="sans-serif"> } catch
(Exception ex) {</font>
<br><font size=2 face="sans-serif">
ex.printStackTrace();</font>
<br><font size=2 face="sans-serif"> }</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif">}</font>
<br>
<br>
<br><font size=2 face="sans-serif">The output looks like this:</font>
<br>
<br>
<br><font size=2 face="sans-serif"><?xml version="1.0" encoding="UTF-8"?></font>
<br><font size=2 face="sans-serif"><Test></font>
<br><font size=2 face="sans-serif"> <value>3</value></font>
<br><font size=2 face="sans-serif"></Test></font>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Tom Faust<br>
Product Architect<br>
Page Digital, Inc.<br>
http://www.synaro.com<br>
<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"Hainer, Neil" <hainern@jivanet.net></b></font>
<br><font size=1 face="sans-serif">Sent by: jdom-interest-admin@jdom.org</font>
<p><font size=1 face="sans-serif">11/18/2003 03:52 PM</font>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To:
<jdom-interest@jdom.org></font>
<br><font size=1 face="sans-serif"> cc:
</font>
<br><font size=1 face="sans-serif"> Subject:
[jdom-interest] XMLOutputter Question</font></table>
<br>
<br>
<br><font size=2><tt>Hi,<br>
<br>
I am reading in an XML document and writing it out using XMLOutputter().
The input document contains <br>
<br>
"<?xml version "1.0" encoding = "UTF-8"?><br>
<br>
as the first line. The output file does not contain this line. Can
someone tell me why? Is there a way to retain it?<br>
<br>
TIA,<br>
<br>
Neil<br>
<br>
Neil Hainer<br>
Booz | Allen | Hamilton<br>
JIVA SI<br>
8613 Lee Hwy<br>
Fairfax, VA 22031<br>
703-289-3881<br>
<br>
_______________________________________________<br>
To control your jdom-interest membership:<br>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com<br>
</tt></font>
<br>