• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
      • From: Thomas Wetmore <email@hidden>
References: 
 >Parsing XML Files Consisting of a Sequence of Top Level Elements (From: Thomas Wetmore <email@hidden>)
 >Re: Parsing XML Files Consisting of a Sequence of Top Level Elements (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Associate icon with file ext. / quick look
  • Next by Date: Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
  • Previous by thread: Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
  • Next by thread: Re: Parsing XML Files Consisting of a Sequence of Top Level Elements
  • Index(es):
    • Date
    • Thread