[jdom-interest] instanceof Text and XMLOutputter request

Jason Hunter jhunter at acm.org
Fri Apr 5 11:45:24 PST 2002


There's quite a few more printXXX() methods than outputString()
methods.  I see ones for printing the decl, element content, content
range, and so on.  

Funny, printElementContent() isn't used anywhere in JDOM anymore.  It's
just a pass-through to printContent().  Why's is still there?  I also
see outputElementContent() but no outputContent().

I'd suggest adding the String variety for elt content, except the name
is necessarily odd.  All the other methods are outputString(Foo) but
Element would have two varieties of output, so you need to mangle the
method name.  Is it worth it?

-jh-

Todd O'Bryan wrote:
> 
> Oh, this works fine. But since there seems to be an implied parallelism
> between output and outputString methods in the XMLOutputter class, my
> point is that the lack of a String-producing version of
> outputElementContent is inconsistent with the rest of the class.
> 
> I don't mind writing a few lines of extra code, but I kept looking for
> the method that would do what I wanted, because once I found
> outputElementContent I assumed there had to be a String version in there
> somewhere, given the rest of the code.
> 
> Todd
> 
> On Wednesday, April 3, 2002, at 08:51 PM, Philip Nelson wrote:
> 
> >
> >> (a) String outputElementContentAsString(Element e)
> >
> > How about (and I am doing this from memory but...)
> >
> > StringWriter sw = new StringWriter()
> > XMLOutputter out = new XMLOutputter(sw);
> > out.output(yourElement);
> > String whatYouWant = sw.toString();
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Tax Center - online filing with TurboTax
> > http://taxes.yahoo.com/
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-
> > interest/youraddr at yourhost.com
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list