discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re;: NSXMLParser on GS (was Re: Books / GNUStep / XML)


From: Dr. H. Nikolaus Schaller
Subject: Re: Re;: NSXMLParser on GS (was Re: Books / GNUStep / XML)
Date: Mon, 18 Oct 2004 20:08:56 +0200

Am 18.10.2004 um 17:22 schrieb Adrian Robert:

On Oct 18, 2004, at 3:49 AM, Dr. Nikolaus Schaller wrote:

Dear all,
we have a first (90%) implementation of NSXMLParser (and

I like the sound of this, but it also must be said that implementing a fully standards-compliant XML parser with good performance is not a minor task. The

Yes, performance is good by the architecture we have chosen - but mainly depends on the speed of generating NSStrings from UTF8 character sequences.

use of libxml2 has the benefit that it is a mature implementation that receives lots of testing and dots/crosses all or most of the i's and t's in the specification.

I appreciate that the focus of myStep is different from GNUstep. Is the goal of your project's NSXMLParser code to provide an XML implementation to this level, or is it intended more to be used in special cases, such as archive I/O, where the XML formats and needed behaviors are a controlled subset of the full range of possibilities?

Currently it does not read and process any !DOCTYPE or !ENTITY. And handling of errors is not foolproof. But scanning&parsing tags with attributes, parsing values between tags and handling the 5 standard entities (e.g. &) works. This is sufficient to properly parse Cocoa Property Lists. The goal is to be more and more compatible to NSXMLParser - but I don't know if that class is a full XML parser that can handle all special cases.

I have e.g. not yet found out if it really loads a remote !DOCTYPE to handle additional entity definitions - and what happens if there is no network connection available. And my experiments have shown that it does not handle lineNumber and columnNumber properly. Finally, I think the NSError returns of NSXMLParser are not very helpful...

If the latter, does your design make it possible to implement some type of runtime switching behavior so that libxml2 could be used (behind the same API) instead of the native implementation if needed? Runtime parser selection is the norm in the Java world, and while it can cause inconvenience at times, it often comes in handy as well.

I think GNUstep should provide both: NSXMLParser being compatible to Cocoa - and a real libxml2 wrapper that can be conditionally compiled in. So users can decide if they want to be platform independent (i.e. compile their apps with Cocoa) and have restricted XML parsing or to use some GSXMPParser (that is not readily available on the Mac).

Nikolaus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]