Re: Where is NSXMLChildren defined?
Re: Where is NSXMLChildren defined?
- Subject: Re: Where is NSXMLChildren defined?
- From: Tito Ciuro <email@hidden>
- Date: Tue, 28 Jun 2005 09:11:12 -0400
Hello,
On 28/06/2005, at 7:41, Finlay Dobbie wrote:
On 6/28/05, Tito Ciuro <email@hidden> wrote:
Debugging an XML document I got this output:
<NSXMLChildren 0x388a30>(
xsi:type="xsd:float"
)
What is NSXMLChildren and what methods may I invoke on it?
How did you get it? The API that returned it to you should provide
some context as to what it is. Anyway, it seems that it's a private
subclass of NSMutableArray.
Here's the code:
NSXMLDocument *doc = [[[NSXMLDocument alloc] initWithData:data
options:NSXMLNodeOptionsNone error:&error] autorelease];
// Get the body
NSArray *body = [doc nodesForXPath:@"SOAP-ENV:Envelope/SOAP-
ENV:Body" error:&error];
NSXMLElement *bodyElement = [body objectAtIndex:0];
NSArray *bodyChildren = [bodyElement children];
The debugger stuff:
(gdb) p(int) [[bodyChildren objectAtIndex:0]childCount]
$1 = 2
(gdb) po [[bodyChildren objectAtIndex:0]childAtIndex:0]
<Number_1 xsi:type="xsd:float">0</Number_1>
(gdb) po [[[bodyChildren objectAtIndex:0]childAtIndex:0]class]
NSXMLElement
(gdb) po [[[bodyChildren objectAtIndex:0]childAtIndex:0]attributes]
<NSXMLChildren 0x3897a0>(
xsi:type="xsd:float"
)
(gdb) po [[[[bodyChildren objectAtIndex:0]childAtIndex:0]attributes]
objectAtIndex:0]
xsi:type="xsd:float"
(gdb) po [[[[[bodyChildren objectAtIndex:0]childAtIndex:0]
attributes]objectAtIndex:0]class]
NSXMLNamedNode
So yes, you're right, NSXMLChildren is a sublass of NSArray and
contains one element of type NSXMLNamedNode. What is NSXMLNamedNode?
Is it just a subclass of NSString? I cannot seem to invoke any XML-
related methods on it...
Thanks again,
-- Tito
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden