Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
- Subject: Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
- From: koko <email@hidden>
- Date: Mon, 22 Oct 2012 11:02:57 -0600
/*************************************************************************
Called to parse an element. We make a selector from the element name and
then if we respond to selector it is called from here. Selectors we respond
to have an attribute dictionary
*************************************************************************/
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
{
m_selString = [NSString stringWithFormat:@"%@:",elementName];
SEL selector = NSSelectorFromString(m_selString);
if([self respondsToSelector:selector])
[self performSelector:selector withObject:attributeDict];
}
On Oct 21, 2012, at 4:02 PM, Graham Cox wrote:
>
> On 21/10/2012, at 9:50 PM, Thomas Wetmore <email@hidden> wrote:
>
>> Is there a way to easily parse an XML file consisting of a sequence of top level elements?
>
>
> What about NSXMLParser? This gives you finer-grained access to the XML without expecting a specific structure (other than valid XML).
>
> --Graham
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden