[jdom-interest] XMLOutputter format question

da at vizbang.com da at vizbang.com
Wed Sep 29 14:45:32 PDT 2004


hi jdom-i,

i was unable to locate a copy of the 2nd edition of "java & xml" at any of
my local booksellers and i'm on too unfortunate of a schedule to wait for
amazon, so i'm new on the list and hoping someone can help.

i'm debugging some rather sprawling chatbot code that was written to an
earlier version of the jdom API.  actually, several earlier versions,
apparently.  it's quite a mess.  rather than try to sort out which modules
work with which versions, i'm trying to update the whole thing to 1.0.

overall, this is going well.  it's a nice API and pretty familiar
territory, although my java fu is definitely weak and rusty.  the one
problem i'm having is with some code that used to say this...

  outputter = new org.jdom.output.XMLOutputter("", false);
  outputter.setTextNormalize(true);
  outputter.setOmitDeclaration(true);

i tried rewriting it like this...

  org.jdom.output.Format f = new org.jdom.output.Format();
  f.setTextMode(org.jdom.output.Format.TextMode.NORMALIZE);
  f.setOmitDeclaration(true);
  outputter = new org.jdom.output.XMLOutputter(f);

but i'm getting this error on that first line: "Format() has private
access in org.jdom.output.Format." (hrunh?)  i've tried a number of
variations on this that have yielded other errors.

it seems like all the examples i've been able to locate are written to
earlier versions.  is there a secret cache of 1.0 examples around (other
than, i presume, in the book)?  if not, can someone nudge me in the right
direction?

thanks!

dan

da  -  dan  ancona
you have the power
http://vizbang.com


More information about the jdom-interest mailing list