Ticket #92 (closed defect: fixed)
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.
