Re: Cocoa datatype SOAP encoding
Re: Cocoa datatype SOAP encoding
- Subject: Re: Cocoa datatype SOAP encoding
- From: Quinn <email@hidden>
- Date: Tue, 25 Nov 2008 22:22:17 +0000
At 13:13 -0800 25/11/08, Tom Chen wrote:
Does anyone know what Cocoa datatype is needed?
I think you need to investigate NSXMLDocument. It allows you to
create an XML document with arbitrary elements. For example, I
prototyped creating your XML in Python:
$ python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
from Foundation import *
root = NSXMLElement.alloc().initWithName_("something")
doc = NSXMLDocument.alloc().initWithRootElement_(root)
f = NSXMLElement.alloc().initWithName_("Field")
root.addChild_(f)
f = NSXMLElement.alloc().initWithName_("Field")
root.addChild_(f)
f = NSXMLElement.alloc().initWithName_("Field")
root.addChild_(f)
d = doc.XMLDataWithOptions_(NSXMLNodePrettyPrint)
print NSString.alloc().initWithData_encoding_(d, NSUTF8StringEncoding)
<something>
<Field></Field>
<Field></Field>
<Field></Field>
</something>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden