Warning: Can't synchronize with the repository (Unsupported version control system "hg": "Couldn't import symbols: RepoError" ). Look in the Trac log for more information.

Ticket #92 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

sax2parser does not fire doctype event to listeners

Reported by: jeff.barczewski@… Owned by: ser
Priority: normal Milestone: 3.1.7
Component: SAX2 Version: 3.1.5
Severity: normal Keywords: doctype sax2
Cc: Ruby version: 1.8.4
Operating system: All

Description

sax2parser does not fire doctype event to listeners.

For instance given this xml

<?xml version="1.0"?> <!DOCTYPE greeting PUBLIC "Hello Greeting DTD" "http://foo/hello.dtd"> <greeting>Hello, world!</greeting>

No doctype events will be triggered in sax2listeners

Additionally if a doctype with a missing name is specified, a ParseException? is not generated as was intended in the code.

For this xml

<?xml version="1.0"?> <!DOCTYPE > <greeting>Hello, world!</greeting>

rexml will try to execute REXML::ParseException?("DOCTYPE is missing a name") when it should be trying to create new parse Exception as follows

raise REXML::ParseException?.new("DOCTYPE is missing a name")

It was missing the '.new' in the code.

I will attach a patch which contains two test cases and the fixes so it can be applied to the next release. This patch should resolve both issues.

Attachments

doctype.patch (4.9 kB) - added by jeff.barczewski@… 3 years ago.
Patch containing test cases and fixes for doctype sax event and missing name exception

Change History

Changed 3 years ago by jeff.barczewski@…

Patch containing test cases and fixes for doctype sax event and missing name exception

Changed 3 years ago by ser

  • status changed from new to assigned
  • milestone set to 3.1.7

Changed 2 years ago by ser

  • status changed from assigned to closed
  • resolution set to fixed

Fixed by changeset:1259.

Thanks for the patch. See the commit log for more details.

Note: See TracTickets for help on using tickets.