[jdom-interest] XMLOutputter and Comments

Jason Hunter jhunter at collab.net
Tue Jun 20 11:24:05 PDT 2000


+1 on everything from me as well.  Great ideas.

-jh-

Brett McLaughlin wrote:
> 
> Elliotte Rusty Harold wrote:
> >
> > I've revised XMLOutputter to not use PrintWriter and to throw more
> > IOExceptions. I'll submit that shortly.
> 
> +1
> 
> I'd like to propose several
> > more API changes that make the API more consistent and more useful for
> > some edge cases.
> >
> > First, I'd like to output comments by adding this method:
> >
> > protected void printComment(Comment comment, Writer out)  throws
> > IOException {}
> 
> +1
> 
> >
> > This is more symmetrical with how other nodes are handled. It also makes
> > it very easy to write an outputter that strips comments by overriding
> > this method to do nothing. I thought of this when I wrote an outputter
> > that stripped everything except text content, and my comments showed up
> > anyway. The reason is because they're currently handled by invoking
> > getSerializedForm() in  printElement() and output() rather than
> > directly.
> >
> > Next, I'd like to add a printEntity() method like this:
> >
> > protected void printEntity(Entity entity, Writer out) throws IOException
> > {}
> 
> +1
> 
> >
> > By overriding this method, subclasses could place entities in separate
> > files, though I wouldn't make this the default behavior.
> 
> Good idea.
> 
> >
> > Next, I'd like to change the plural
> >
> > protected void printProcessingInstructions(List pis, Writer out) throws
> > IOException {}
> >
> > to the singular
> >
> > protected void printProcessingInstruction(ProcessingInstruction pi,
> > Writer out) throws IOException {}
> 
> +1
> 
> >
> > Along with some other not particularly difficult changes to the other
> > methods, this would let the outputter maintain the order and location of
> > processing instructions in the document.
> >
> > What do you think?
> 
> I think you're onto some good ideas - I'm all for all of them. It's also
> nice because the external API stays consistent ;-)
> 
> -Brett

Received: from russian-caravan.cloud9.net (russian-caravan.cloud9.net [168.100.1.4])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id LAA23972
	for <jdom-interest at jdom.org>; Tue, 20 Jun 2000 11:39:10 -0600 (MDT)
Received: from [168.100.203.234] (macfaq.dialup.cloud9.net [168.100.203.234])
	by russian-caravan.cloud9.net (Postfix) with ESMTP
	id 400C876302; Tue, 20 Jun 2000 13:38:24 -0400 (EDT)
Mime-Version: 1.0
X-Sender: elharo at luna.oit.unc.edu
Message-Id: <v04210107b5755ba1a0b6@[168.100.203.234]>
In-Reply-To: 
 <D5A1ECFA75B3D111B02C00805F85F47D02BD6C at s-tiphaine.sophia.cnet.fr>
References: 
 <D5A1ECFA75B3D111B02C00805F85F47D02BD6C at s-tiphaine.sophia.cnet.fr>
Date: Tue, 20 Jun 2000 13:36:36 -0400
To: elharo at metalab.unc.edu
From: Elliotte Rusty Harold <elharo at metalab.unc.edu>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
Subject: [jdom-interest] JDOM Talk in NYC, Monday, June 26, 2000 at XMLDevCon
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

Next Monday, June 26, I'll be giving an introductory talk about JDOM 
at the meeting of the New York C++ & Java SIG of the New York PC 
Users' Group at XMLDevCon. The meeting starts at 6:45 in the Gramercy 
B Room of the New York Hilton (where the XMLDevCon show is being 
held) and runs till roughly 8:00. I'll be showing off JDOM basics and 
comparing and contrasting it to SAX2 and DOM.

Admission is free. You do not need to be registered at XMLDevCon to 
attend, though you may want to register for a free XMLDevCon special 
events pass if you want to see the keynotes or wander the show floor 
as well <http://www.sys-con.com/xmlcon/specevents.htm>. For those who 
aren't at the show, I'll post the slides and examples on Cafe con 
Leche in the near future.

+-----------------------+------------------------+-------------------+
| 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