Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6218515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:37:24+00:00 2026-05-24T07:37:24+00:00

?xml version=1.0 encoding=UTF-8 ?> <IPAD version=1.0> <articleSnapshot> <item> <categoryName>Kerala</categoryName> <oid>2915</oid> <title>ÎÆcÈÏ¢: ÄßøáJW ÕçKAá¢</title> <thumbImage>http://122.248.234.55/v3/repository/images/news/bar-liquor_thuthumb_2915.jpg</thumbImage>

  • 0
?xml version="1.0" encoding="UTF-8" ?>  <IPAD version="1.0"> 
<articleSnapshot>
<item>
<categoryName>Kerala</categoryName>
<oid>2915</oid>
<title>ÎÆcÈÏ¢: ÄßøáJW ÕçKAá¢</title>
<thumbImage>http://122.248.234.55/v3/repository/images/news/bar-liquor_thuthumb_2915.jpg</thumbImage>
<shortDescription>ÎÆcÈÏÕᢠ¥Äßæa dÉ~cÞÉÈÕáÎÞÏß ÌtæMGí ©ÏVK ÕßÎVÖÈBZ ÏáÁß®Ëá¢...</shortDescription>
</item>
</articleSnapshot>
</IPAD>

I want to parse this xml file and display it in viewdidload.i have completed the coding.but cant display in image view and textview seperately.Please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:37:25+00:00Added an answer on May 24, 2026 at 7:37 am

    This is how I parse an XML file very similar to yours. This basically converts the XML into a plist file.

    #pragma mark - Delegate Received
    
    -(void)parsingComplete:(XMLDataSource*)theParser {
        NSArray *categoryArray = [theParser getCategories];
        [categoryArray writeToFile:PLIST atomically:YES];
    }
    - (void)receivedItems:(NSArray *)theItems {
        NSMutableArray *dataItems = [[NSMutableArray alloc] init];
        [dataItems addObjectsFromArray:[NSArray arrayWithContentsOfFile:PLIST]];
    
        NSDictionary * dataItem = [dataItems objectAtIndex:categoryIndex];
        data_ =  [dataItem objectForKey:@"images"];
    }
    
    #pragma mark - Parsing Delegates
    
    - (void)parse:(NSData *)data withDelegate:(id)sender onComplete:(SEL)callback 
    {
        parentDelegate = sender;
        onCompleteCallback = callback;
        loading = YES;
    
        NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data];
        [parser setDelegate:self];
        [parser setShouldProcessNamespaces:NO];
        [parser setShouldReportNamespacePrefixes:NO];
        [parser setShouldResolveExternalEntities:NO];
        [parser parse];
    }
    - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
        parsed = NO;
        loading = NO;
    }
    - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI
    qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict 
    {
        NSString *element = [elementName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
        currentElement = element;
        if ([[currentElement lowercaseString] isEqual:@"image"]) {
            inImage = YES;
            itemsDictionary = [[NSMutableDictionary alloc] init];
            [itemsDictionary addEntriesFromDictionary:attributeDict];
        }
    
        if ([[currentElement lowercaseString] isEqual:@"category"]) {
            inCategory = YES;
            categoryDictionary = [[NSMutableDictionary alloc] init];
            [categoryDictionary addEntriesFromDictionary:attributeDict];
        }
    }
    
    - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI
    qualifiedName:(NSString *)qName 
    {
        NSString *element = [elementName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
        if ([[element lowercaseString] isEqual:@"image"]) {
            inImage = NO;
            [items addObject:[itemsDictionary copy]];
        }
    
        if ([[element lowercaseString] isEqual:@"category"]) {
            inCategory = NO;
            [categoryDictionary setObject:[items copy] forKey:@"images"];
            [items removeAllObjects];
            [categories addObject:[categoryDictionary copy]];
        }
    }
    - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string 
    {
        NSString *stringValue = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
        NSString *element = [currentElement stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    
        /*  skip over blank elements.  */
        if (stringValue == nil || [stringValue isEqual:@""]) {
            return;
        }
    
        if (element != nil && [element length] > 0) {
            if (inImage) {
                if ([itemsDictionary objectForKey:element] != nil) {
                    [itemsDictionary setObject:[NSString stringWithFormat:@"%@%@", [itemsDictionary objectForKey:element], stringValue]
                                        forKey:element];
                } else {
                    [itemsDictionary setObject:stringValue forKey:element];
                }
            } else if ((!inImage) && (inCategory)) {
                if ([categoryDictionary objectForKey:element] != nil) {
                    [categoryDictionary setObject:[NSString stringWithFormat:@"%@%@", [categoryDictionary objectForKey:element], stringValue]
                                           forKey:element];
                } else {
                    [categoryDictionary setObject:stringValue forKey:element];
                }
            } else {
                if ([root objectForKey:element] != nil) {
                    [root setObject:stringValue forKey:element];
                }
            }
        }
    }
    - (void)parserDidStartDocument:(NSXMLParser *)parser {
        NSError * err;
        if(![[NSFileManager defaultManager] fileExistsAtPath:PLIST]) {
            [[NSFileManager defaultManager] removeItemAtPath:PLIST error:&err];
        }
    }
    - (void)parserDidEndDocument:(NSXMLParser *)parser 
    {
        parsed = YES;
        loading = NO;
    
        if ([parentDelegate respondsToSelector:onCompleteCallback]) {
            [parentDelegate performSelector:onCompleteCallback withObject:self];
        }
    
        if ([self respondsToSelector:@selector(receivedItems:)])
            [self receivedItems:items];
        else
            SHOW_ALERT(@"parserDidEndDocument:", @"receivedItems: not responding!", nil, @"Okay", nil)
    }
    
    
    #pragma mark -
    #pragma mark Setters / Getters
    
    - (id)delegate {
        return self;
    }
    - (void)setDelegate:(id)new_delegate {
        _delegate = self;
    }
    - (BOOL)isSuccessful {
        return success;
    }
    - (BOOL)isLoading {
        return loading;
    }
    - (BOOL)isParsed {
        return parsed;
    }
    - (NSArray *)getCategories {
        return categories;
    }
    - (NSDictionary *)getRoot {
        return root;
    }
    - (void)dealloc {
        [super dealloc];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the XML: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <feed xmlns=http://www.w3.org/2005/Atom xmlns:dc=http://purl.org/dc/elements/1.1/> <title>Rated Images</title> <link
I have this XML at http://localhost/file.xml : <?xml version=1.0 encoding=utf-8?> <val:Root xmlns:val=http://www.hw-group.com/XMLSchema/ste/values.xsd> <Agent> <Version>2.0.3</Version>
have an xml file like this. <?xml version =1.0 encoding =utf-8?> <menu> <menuNode title=Register
I have the generic structure here: <?xml version=1.0 encoding=UTF-8?> <SOAP-ENV:Envelope xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/ xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/
I have this html doc: <?xml version=1.0 encoding=utf-8?><!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1
I am trying to parse the following XML with javascript: <?xml version='1.0' encoding='UTF-8'?> <ResultSet>
This is my xhtml code : <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC -//W3C//DTD
I have the following simplified XML: <?xml version="1.0" encoding="UTF-8" ?> <MATMAS05> <IDOC BEGIN="1"> <E1MARAM
I have the following simplified XML structure: <?xml version="1.0" encoding="UTF-8" ?> <INVOIC02> <IDOC BEGIN="1">

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.