Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFXMLParser problem



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&amp;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: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.