[jdom-interest] Processing Instruction

Jason Hunter jhunter at collab.net
Fri Jan 12 17:29:43 PST 2001


Alessandro Marcellini wrote:
> 
> Hi,
> I'm using jdom-b5 to write down a file (using jdk1.1.8 on Winnt).
> I've encuntered some problem with the XMLOutputter:
> 1) The processing instruction that I add to my document is written at
> the end of the file. But I want it to be at the begin.
> I've used this code to generate my PI:
>       map.put("href", getStylesheetName(flog.getPath()));
>       map.put("type", "text/xsl");
>       doc.addContent(new ProcessingInstruction("xml-stylesheet", map));
> Where doc is my document. What is wrong in my code?

We just talked about this days ago.  Check the archives.

> 2) My program reads the file that writes, but each time that writes the
> file add newlines to the content previously read.
> What I've to do?

Tell XMLOutputter not to add new lines.  It's in the docs, boolean
parameter.

-jh-



More information about the jdom-interest mailing list