Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-09-2011, 03:04 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2011
Posts: 2
mturhan55 is on a distinguished road
Default NSXMLParser and HTML Markup problem

Hi,
I need to parse a xml document which is contains some html markup. For
example :

<news>
<spot> bla bla </spot>
<detail> some kind of html markups and text here
lorem ipsum <P>
bla bla bla <B> sdfdfsdf </B>
thatsit
</detail>
<news>

i can parse orderly document without like <P> <B> html markups.
but if there are any htmlmarkups in xml document like above i cannot
parse.
how can i do it ?
please help
mturhan55 is offline   Reply With Quote
Old 10-09-2011, 11:47 AM   #2 (permalink)
Registered Member
 
Join Date: Oct 2011
Posts: 2
mturhan55 is on a distinguished road
Default

my xml parser code here :

NSXMLPARSER.
example parser code here :
- (void)parserNSXMLParser *)parser didEndElementNSString
*)elementName
namespaceURINSString *)namespaceURI qualifiedNameNSString
*)qName {
if([elementName isEqualToString:@"news"])
return;
if([elementName isEqualToString:@"newsitem"]) {
[appDelegate.news addObject:aNews];
[aNews release];
aNews = nil;
}
else if ([elementName isEqualToString:@"newsid"]){
currentElementValue = nil;
return;
}
else if ([elementName isEqualToString:@"newsspot"]){
aNews.newsSpot = currentElementValue;
currentElementValue = nil;
}
else if ([elementName isEqualToString:@"detail"]){
aNews.newsDetail = currentElementValue;
currentElementValue = nil;
}
}



any idea ?
mturhan55 is offline   Reply With Quote
Reply

Bookmarks

Tags
html markup, nsxmlparser

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 403
18 members and 385 guests
13dario13, 7twenty7, eski, EvilElf, glenn_sayers, HemiMG, jarv, LunarMoon, morterbaher, n00b, pbart, Pudding, QuantumDoja, sacha1996, Sami Gh, UMAD, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:22 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0