Closed Bug 7015 Opened 25 years ago Closed 25 years ago

XML Parser not conforming to element declarations

Categories

(Core :: XML, defect, P3)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: salwan.searty, Assigned: nisheeth_mozilla)

References

Details

The XML parser in release M5 does not seem to enforce the grammar defined in the element declarations. For example, the following element declarations define the element DOCUMENT to contain at least one LEVEL1 element, and the LEVEL1 element to contain atleast one LEVEL2 element: <?xml version="1.0"?> <!DOCTYPE DOCUMENT [ <!ELEMENT DOCUMENT (LEVEL1)+> <!ELEMENT LEVEL1 (LEVEL2)+> <!ELEMENT LEVEL2 (#PCDATA)> ]> That means the following code should be legal: <DOCUMENT> <LEVEL1> <LEVEL2> Just some text. </LEVEL2> </LEVEL1> </DOCUMENT> While the following code should NOT be legal: (because it doesn't conform to the grammar defined above.) <DOCUMENT> <LEVEL1> Just some text. </LEVEL1> <LEVEL2> Some more text. </LEVEL2> </DOCUMENT> However, even in the second code snippet, the Mozilla does not seem to generate an error.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
Thanks a lot for taking the time to file this bug report. Expat is not a validating parser, so it only reports well-formedness errors. Both the examples you mention are well-formed XML, so, you see no errors. Mozilla will probably do document validation once the XML schema spec gets more baked. We are not planning on doing DTD based validation because DTDs will get deprecated once XML schemas become a W3C Recommendation.
QA Contact: chrisd → janc
Status: RESOLVED → VERIFIED
*** Bug 182604 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.