CFXMLParser problem
CFXMLParser problem
- Subject: CFXMLParser problem
- From: Jesus De Meyer <email@hidden>
- Date: Fri, 30 Sep 2005 12:50:00 +0200
Hi,
I just ran into a bit of a problem with CFXMLParser. For some odd
reason, when I have an entity like this: <link>http://
www.somesite.com/?p=showstuff&id=123</link> the nodeValue of this
entity becomes: http://www.somesite.com/?p=showstuff
The XML file is retrieved over the internet and is saved in an NSData
object, which I then pass to the CFXMLParser. Is there something I'm
missing?
Here's some of the code I use to read the XML file:
CFXMLTreeRef rootXMLTree, tempTree;
CFXMLNodeRef xmlNode;
connectionSuccessful = YES;
if ([feedData length] == 0) return;
rootXMLTree = CFXMLTreeCreateFromData(kCFAllocatorDefault,
(CFDataRef)feedData, NULL, kCFXMLParserSkipWhitespace,
kCFXMLNodeCurrentVersion);
if (rootXMLTree == nil) {
parsedWithErrors = YES;
} else {
int childCount;
int index;
childCount = CFTreeGetChildCount(rootXMLTree);
for (index = childCount - 1; index >= 0; index--) {
tempTree = CFTreeGetChildAtIndex(rootXMLTree, index);
xmlNode = CFXMLTreeGetNode(tempTree);
NSString *nodeString = (NSString*)CFXMLNodeGetString
(xmlNode);
//do something with nodeString, ie check which entity it
represents...
Thanks in advance
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden