zzycami / touchcode

Automatically exported from code.google.com/p/touchcode
0 stars 0 forks source link

Writing XML #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Great stuff. As a developer who needs to write XML files as well (to sync back 
from native iPhone 
app to Rails web app), here's a vote for that! Would love to avoid hacking 
together my own.

Original issue reported on code.google.com by avoc...@gmail.com on 5 Aug 2008 at 10:15

GoogleCodeExporter commented 8 years ago
List of APIs that need to be added for write support:

@interface CXMLNode ( Creation ) 

- (void)addAttribute:(CXMLNode *)attribute; //primitive 
+ (id)attributeWithName:(NSString *)name stringValue:(NSString   
*)stringValue; 
+ (id)elementWithName:(NSString *)name stringValue:(NSString *)string; 
- (void)setStringValue:(NSString *)string; 
- (void)detach; //primitive 

@end 

@interface CXMLElement ( Creation ) 

+ (id)attributeWithName:(NSString *)name stringValue:(NSString   
*)stringValue; 

- (id)initWithName:(NSString *)name; 

- (void)addChild:(CXMLNode *)child; 
- (void)addAttribute:(CXMLNode *)attribute; //primitive 

+ (id)elementWithName:(NSString *)name; 

- (void)setChildren:(NSArray *)children; //primitive 

- (NSArray *)elementsForLocalName:(NSString *)localName URI:(NSString   
*)URI; 

- (NSXMLNode *)namespaceForPrefix:(NSString *)name; 

@end 

Original comment by jwight on 7 Aug 2008 at 2:58

GoogleCodeExporter commented 8 years ago
Moving this to high priority. I know a lot of people want this.

Any volunteers?

If we do add this in it - it should be implemented in such a way that it can be 
disabled easily - either via a 
#define or via inclusion/exclusion of category files.

Original comment by jwight on 7 Aug 2008 at 5:41

GoogleCodeExporter commented 8 years ago
The KissXML project supports all of this:
http://code.google.com/p/kissxml/

Why not just keep TouchXML read-only, and let KissXML handle write support?

Original comment by sean_ro...@yahoo.com on 17 Nov 2008 at 11:32

GoogleCodeExporter commented 8 years ago
Because I need write support and don't want to use two APIs.

It would have been nice if the KissML author had contributed to TouchXML 
instead of forking his own project. Oh 
well.

Preliminary write support (that can be left OUT of your project) is now in 
TouchXML as of around r228. More 
support is being added.

Original comment by jwight on 17 Nov 2008 at 11:59

GoogleCodeExporter commented 8 years ago
I've spoken with the developer of KissXML.  He said he forked a different 
project for two reasons:
1) The TouchXML wiki claimed XML writing/output support was in the long 
term/never category.
2) In order to properly add it, he needed to completely rethink the API.

Just like with CocoaHTTPServer, it seems like this project is doing the same 
thing as KissXML.  Do you think it 
would be possible to work together?

Original comment by sean_ro...@yahoo.com on 19 Nov 2008 at 3:09

GoogleCodeExporter commented 8 years ago
Partial support in place.

Original comment by jwight on 28 Feb 2009 at 7:06