Re: XML and NSCoder
Re: XML and NSCoder
- Subject: Re: XML and NSCoder
- From: Dirk Theisen <email@hidden>
- Date: Tue, 27 Nov 2001 10:16:13 +0100 (Europe/Berlin)
Hi, Simon!
Is there any way to make NSCoder spit out XML? Failing that, is there
a general XML encoding & decoding thing for Objective-C? I've
starting writing my own "emitXML:(NSString *)" for generating XML and
using expat for reading it, but I can't help but thinking that ther
eis a better way.
There is Objective-XML by Marcel Weiher, which is roughly what you want.
The alternative is WOXMLCoding as implemented in WO5 (Java). I am not
aware that they defined an objc protocol for that, but maybe we should.
It looks like the Marcels work could be made compatible with an
interface like the one below with reasonable effort.
Has anybody done work in this direction?
Regards,
Dirk
----------------------
encodeBooleanForKey
public void
encodeBooleanForKey (
boolean,
java.lang.String )
encodeDoubleForKey
public void
encodeDoubleForKey (
double,
java.lang.String )
encodeFloatForKey
public void
encodeFloatForKey (
float,
java.lang.String )
encodeIntForKey
public void
encodeIntForKey (
int,
java.lang.String )
encodeObjectForKey
public void
encodeObjectForKey (
java.lang.Object,
java.lang.String )
encodeRootObjectForKey
public synchronized java.lang.String
encodeRootObjectForKey (
java.lang.Object,
java.lang.String )
...and...
decodeBooleanForKey
public boolean
decodeBooleanForKey (
java.lang.String )
decodeDoubleForKey
public double
decodeDoubleForKey (
java.lang.String )
decodeFloatForKey
public float
decodeFloatForKey (
java.lang.String )
decodeIntForKey
public int
decodeIntForKey (
java.lang.String )
decodeObjectForKey
public java.lang.Object
decodeObjectForKey (
java.lang.String )
decodeRootObject
public synchronized java.lang.Object
decodeRootObject (
com.webobjects.foundation.NSData )
decodeRootObject
public synchronized java.lang.Object
decodeRootObject (
java.lang.String )
decodeRootObject
public synchronized java.lang.Object
decodeRootObject (
org.xml.sax.InputSource )
--
Dirk Theisen <email@hidden>
Diplominformatiker
Rvmerstr. 164, D-53117 Bonn (Germany)
Tel. +4922873-4504 (Fax: -4382)