Re: NSXLMDocument and malformed XML
Re: NSXLMDocument and malformed XML
- Subject: Re: NSXLMDocument and malformed XML
- From: Klaus Backert <email@hidden>
- Date: Fri, 26 May 2006 06:26:37 +0200
Hi,
NSXMLDocument has an option NSXMLDocumentTidyXML for
initWithContentsOfURL:option:error:. The documentation says: "Changes
malformed XML into valid XML during processing of the document".
This would be a devastating functionality for a xml parser.
But look at this from the Tree-Based XML Programming Guide:
"Note: Even though the NSXMLParser has the same prefix as the NSXML
classes, it is not part of NSXML. It is based on a different model
for processing XML".
Therefore, some may say, "the" parser is not involved, and everything
is ok ;-)
But the input data has to be parsed with NSXML too, of course. If
malformed XML is changed into valid XML during processing, then this
parser is not conformant to the W3C recommendations for xml parsers.
This is really bad.
There are opportunities for Chris:
(a) Try the NSXMLDocumentTidyXML option with NSXML.
(b) Try NSXMLParser, calling [theParser setShouldProcessNamespaces:
YES], because NO is the default value.
Klaus
Am 26.05.2006 um 02:31 schrieb Greg Herlihy:
An XML parser is not allowed to perform any type of error recovery
after
detecting that the XML document it is parsing is malformed. Rather the
parser must notify the application of the error and must stop
parsing the
document at that point (though the parser is allowed to search the
remainder
of the document for possible, additional errors and report them as
well.)
<snip>
The XML (and XHTML) philosophy avoids this entire debacle. All XML
parsers
adhere only to standard, defined behavior. An application
generating or
parsing XML documents pledges not to go off on its own - and
pretend to
understand a document that it does not. But it is exactly this
tough-minded,
intolerant approach that really serves the user's best interests
when the
entire picture is considered as a whole.
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden