NSXMLParser doesn't indicate when it has starting parsing DOCTYPE
| Originator: | craig | ||
| Number: | rdar://18976025 | Date Originated: | 14/11/2014 |
| Status: | Open | Resolved: | |
| Product: | OS X SDK | Product Version: | 10.10 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Consider the following XML: <?xml version="1.0" standalone="yes" ?> <!-- comment1 --> <!DOCTYPE xxx SYSTEM "XXX" [ <!-- comment2 --> <!ENTITY blah SYSTEM "BLAH" NDATA note> <!NOTATION note PUBLIC "my notation"> <!ELEMENT xxx (#PCDATA)> ]> <xxx>some text</xxx> NSXMLParser does not have a means of indicating it has entered the DOCTYPE stanza, which means that I can't tell whether comment2 is part of the DOCTYPE or part of the XML body. My app parses and reformats XML documents, so this information is crucial. I thought that I could perhaps use NSXMLDocument instead (even though I lose all the benefits of the streaming parser), however, it has a different problem which means I can't get back the notations (see bug report 18975903) so that isn't a meaningful workaround. Steps to Reproduce: Run the attached project and view the console output. Expected Results: There should be some indicator that the DOCTYPE has been entered. Actual Results: The foundComment method is called, but with no context to indicate we are inside (or outside) the DOCTYPE Version: OS X 10.9.5 (13F34) OS X 10.10 (14A389)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!