[jdom-interest] Debugging jdom event handling

David M. Karr dmkarr at earthlink.net
Sat Mar 9 14:25:30 PST 2002

I'm trying to figure out how to make jdom more "verbose", so I can track all
the document pieces it is finding.  I need to do this because I'm getting a
parsing error from it that I don't understand.

I'm seeing the following exception:

org.jdom.JDOMException: Error on line 7: Value must be quoted.

The beginning of the document I'm trying to parse is this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE calendar-data SYSTEM "file:./calendarData.dtd">
  <event-type id="birthday" color="green">Birthdays</event-type>
  <event-type id="holiday" color="blue">Holidays</event-type>
  <event-type id="inservice" color="yellow">In-Service Days</event-type>
  <event-type id="misc" color="grey">Miscellaneous</event-type>

I've stared and stared at this, and I don't see anything wrong with line 7, or
any of the lines around it.  I was thinking that if I could interpose event
handlers so I could add print statements, I could watch the process a little

I also had some trouble getting the "DOCTYPE" element correct, the system
identifier in particular.  I tried using just "file:calendarData.dtd", but that
got an exception:

  Relative URI "file:calendarData.dtd"; can not be resolved without a base URI. 

David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr at earthlink.net

More information about the jdom-interest mailing list