[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re;: NSXMLParser on GS (was Re: Books / GNUStep / XML)
From: |
Helge Hess |
Subject: |
Re: Re;: NSXMLParser on GS (was Re: Books / GNUStep / XML) |
Date: |
Tue, 19 Oct 2004 12:50:30 +0200 |
On Oct 18, 2004, at 23:42, Marcus Müller wrote:
Last time I checked Apple's implementation (around 6 months ago)
namespace support was broken,
...
Anyhow the general API of NSXMLParser isn't bad at all and a working
GS implementation in base would be desirable IMO.
Incorrect ;-)
AFAIK the namespace support is just fine according to the API. The
issue is that the _API_ doesn't (explicitly) support namespaced
attributes, well, at least it doesn't document how this is supposed to
work.
---snip---
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString
*)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString
*)qualifiedName
attributes:(NSDictionary *)attributeDict
---snap---
As you can see attributes are passed in as a NSDictionary. I assume
(and this is how it is implemented in Cocoa) that the key of the dict
is the attribute name and the value the attribute value. Yet with
"namespace names" have name/uri/qname and this (important) information
is lost.
There are various options for making this work with the current API
("{nsuri}value" keys or array keys or special object key), but until
Apple shows us the way, we can't have interoperability (and therefore
cannot use NSXMLParser for XML documents with namespaces [= most XML
stuff today]).
BTW: in SAX there is a special object for that issue, SaxAttributes:
http://svn.opengroupware.org/viewcvs/trunk/sope-xml/SaxObjC/
SaxAttributes.h?rev=33&root=SOPE&view=auto
Greets,
Helge
--
http://docs.opengroupware.org/Members/helge/
OpenGroupware.org
Message not available