[jdom-interest] Getting mixed content as string?

Alex Chaffee guru at edamame.stinky.com
Wed Jul 5 00:59:41 PDT 2000


On Tue, Jul 04, 2000 at 12:17:27PM -0700, Jason Hunter wrote:
> > Remind me again, what method should I call to get the string
> > 
> > "<a href='http://www.jguru.com/'>jGuru</a>, the rockingest Java
> > portal, is ready for action."
> > 
> > from the source element
> > 
> > <item>
> > <title>jGuru Launches</title>
> > <url>http://www.jguru.com</url>
> > <date>December, 1999</date>
> > <description>
> > <a href='http://www.jguru.com/'>jGuru</a>,
> > the rockingest Java portal, is ready for action.
> > </description>
> > </item>

> No need to propose a new method; that's what getSerializedForm() is
> supposed to do.  It's just, as you saw, unimplemented.  

Actually, as I understand it, getSerializedFrom will return the string
"<description><a href='http://www.jguru.com/'>jGuru</a>, the
rockingest Java portal, is ready for action.  </description>", not 
"<a href='http://www.jguru.com/'>jGuru</a>, the rockingest Java
portal, is ready for action.", which is what I want.

I agree it should hook onto XMLOutputter.  I think that yes, we want a
public API for XMLOutputter containing methods for outputting an
Element and an Attribute in addition to a Document.  Hell, why not a
PI, Comment, Entity et al while we're at it?  Also, the outputter
should be configurable like we mentioned before to provide any
combination of output options like whitespace, indentation, auto-close
vs close-tag for empty elements, show or hide surrounding tags, etc.

Moreover, getSerializedForm should be removed from the API altogether.


More information about the jdom-interest mailing list