sElouiseDismorei
New Member
while parse the xml, not full data is getting after some word line end with read morebelow three codes are in a single html page i spited that for better understanding.i am parsing this in to my iPhone app using NSXMLParser.problem is its parsing till \[code\]<Style>\[/code\] below then it stops parsing from the text after that and completely ignores the data below the text!!!\[code\]<head> <title>North Mobile County Middle School: Latest News > "1st Annual NMCK-8 Christmas Music Program"</title> <META HTTP-EQUIV="X-UA-COMPATIBLE" CONTENT="IE=EmulateIE9"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="imagetoolbar" content="no"> <script type="text/javascript" src="http://stackoverflow.com/questions/14066329/JavaScripts.js"></script> <script type="text/javascript" src="http://stackoverflow.com/questions/14066329/JavaScripts/NiceTitles.js"></script> <style type="text/css">\[/code\]i am splitting the code for better understanding \[code\]!--body { margin:0; padding:0; background: #fff;} body, td { font: normal 13px "Trebuchet MS", Arial, Helvetica, sans-serif; color:#333;}/***********************************************//* Links/***********************************************/ a:link, a:visited { color: #CD0000; text-decoration: none;}a:hover, a:active { color: #06f; text-decoration: underline;}img {border: 0;}\[/code\]i am splitting the code for better understanding\[code\]#MainPageArea {padding: 0 15px 15px 15px}</style> <link href="http://images.pcmac.org/SiSFiles/Schools/AL/MobileCounty/NorthMobileMiddle/styles.css" rel="stylesheet" type="text/css"> <!--[if lt IE 7]> <link href="http://stackoverflow.com/questions/14066329/Common/CommonIncludes/Template11/IEStyles.css" rel="stylesheet" type="text/css"> <![endif]--> <link rel="Shortcut Icon" type="image/ico" href="http://images.pcmac.org/SiSFiles/Schools/AL/MobileCounty/NorthMobileMiddle/images/favicon.ico" /></head><body class="DefaultPage"> <table align="center" cellpadding="0" cellspacing="0" width="986" border="0" id="PageWrapper"> <tr> <td valign="top"> <div id="Header">\[/code\]i am using code as below:\[code\]-(id) loadHtmlByURLNSString *)urlString{ NSURL *url = [NSURL URLWithString:urlString]; NSData *nsData = http://stackoverflow.com/questions/14066329/[[NSData alloc] initWithContentsOfURL:url]; elementArray = [[NSMutableArray alloc] init]; parser = [[NSXMLParser alloc] initWithData:nsData]; parser.delegate = self; [parser parse]; currentHTMLElement = [HtmlElement alloc]; return self;}- (void) parserNSXMLParser *)parser didStartElementNSString *)elementname namespaceURINSString *)namespaceURI qualifiedNameNSString *)qName attributesNSDictionary *)attributeDict{ NSLog(@"%@",elementname); currentHTMLElement = [[HtmlElement alloc] autorelease];}- (void) parserNSXMLParser *)parser didEndElementNSString *)elementname namespaceURINSString *)namespaceURI qualifiedNameNSString *)qName{ NSLog(@"%@",elementname);if ([elementname isEqualToString"head"]) { currentHTMLElement.tag = elementname; currentHTMLElement.value = http://stackoverflow.com/questions/14066329/currentNodeContent; [elementArray addObject:currentHTMLElement]; currentHTMLElement = nil; currentNodeContent = nil; // NSLog(@"x%@",elementArray); }\[/code\]can i know were i was struck