Closed
Bug 113438
Opened 23 years ago
Closed 23 years ago
bugzilla.dtd is wrong
Categories
(Bugzilla :: Bugzilla-General, defect, P3)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.16
People
(Reporter: jr, Assigned: justdave)
Details
Attachments
(3 files)
The dtd of the bugzilla-distribution is wrong and leads to XML-Parser-Errors
when reading bugs created by xml.cgi. Specifically, long_desc? has to be
replaced by long_desc*, since there may be one or more long_desc's of a bug.
valid dtd which can be used for validating bugzilla xml docs. Even xml docs
containing just
<bug error="NotFound">
<bug_id>133400</bug_id>
</bug>
will be validated correctly (in contrast to bugzilla-option1.dtd
Comment 3•23 years ago
|
||
This is probably an error in libxml2, but I'll mention it here anyway since I
don't know for sure :)
I was working on using XML::LibXML (which is an "Interface to the gnome libxml2
library" - http://search.cpan.org/doc/MSERGEANT/XML-LibXML-1.31/LibXML.pm), and
came across the $doc->is_valid() method. I got the following results:
bugzilla.dtd as found in CVS:
It always reports and invalid document
"option 1" attached here:
Valid for normal bugs
Invalid for bugs that are NotPermitted or NotFound (as expected)
"option 2" attached here:
Valid for bug that are NotPermitted or NotFound
core dump for normal bugs (stating an "Illegal Instruction")
I don't know enough about DTD's to be certain that the synax used in the
<!ELEMENT bug> is correct or not, so I don't know for sure if this in an error
with this DTD or with libxml2 (or even XML::LibXML).
Comment 4•23 years ago
|
||
Reassigning to author...
Jan, see my previous comment.
Assignee: justdave → tamino_xml
Hi,
the syntax of the "option 2" DTD should be okay according "3.2.1 Element
Content" of W3C XML Recommendation (see http://www.w3.org/TR/2000/REC-xml-
20001006 ).
Assignee: tamino_xml → justdave
Hi,
I had a closer look at the XML spec and bugzilla dtd (option 2):
Unfortunately the dtd (option 2) leads to a non-deterministic content model
which is not conform to the XML spec, I cite from the XML spec:
################################
The content of an element matches a content model if and only if it is possible
to trace out a path through the content model, obeying the sequence, choice,
and repetition operators and matching each element in the content against an
element type in the content model. For compatibility, it is an error if an
element in the document can match more than one occurrence of an element type
in the content model. For more information, see E Deterministic Content Models.
E Deterministic Content Models (Non-Normative)
As noted in 3.2.1 Element Content, it is required that content models in
element type declarations be deterministic. This requirement is for
compatibility with SGML (which calls deterministic content
models "unambiguous"); XML processors built using SGML systems may flag non-
deterministic content models as errors.
For example, the content model ((b, c) | (b, d)) is non-deterministic, because
given an initial b the XML processor cannot know which b in the model is being
matched without looking ahead to see which element follows the b. In this case,
the two references to b can be collapsed into a single reference, making the
model read (b, (c | d)). An initial b now clearly matches only a single name in
the content model. The processor doesn't need to look ahead to see what
follows; either c or d would be accepted.
################################
CONCLUSION:
!!! do not use bugzilla option 2 dtd because it is non-deterministic !!!
SOLUTION:
Use the "bugzilla final version 1 dtd" which I attached. Please check whether
this
dtd works for you. I checked it with XML-Spy, generated an XML Schema from
this dtd with Tamino Schema editor and loaded this XML schema into Tamino.
Now it is possible to store and retrieve bugzilla xml docs using Software AG's
Tamino XML server.
Best regards,
Jan
Updated•23 years ago
|
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.18
Comment 8•23 years ago
|
||
Comment on attachment 63969 [details]
bugzilla final version 1 DTD
With this last revision, xml.cgi output on my local install validates properly
and doesn't cause LibXML to crash. Low risk as it only effects XML output
validation, so no second review needed.
Attachment #63969 -
Flags: review+
Comment 9•23 years ago
|
||
Checking in bugzilla.dtd;
/cvsroot/mozilla/webtools/bugzilla/bugzilla.dtd,v <-- bugzilla.dtd
new revision: 1.4; previous revision: 1.3
done
Target Milestone: Bugzilla 2.18 → Bugzilla 2.16
Comment 10•23 years ago
|
||
Comment on attachment 63969 [details]
bugzilla final version 1 DTD
Yeah, but it misses the InvalidBugId error I added as part of the taint
stuff.....
Attachment #63969 -
Flags: review-
Comment 11•23 years ago
|
||
but jake fixed that, so ignore me ;)
Updated•23 years ago
|
Attachment #63969 -
Flags: review-
Comment 12•23 years ago
|
||
Gotta click that darned Resolve button :)
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•