• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Help with CFXMLTreeCreateFromData with an NSMutableURLRequest response.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with CFXMLTreeCreateFromData with an NSMutableURLRequest response.


  • Subject: Help with CFXMLTreeCreateFromData with an NSMutableURLRequest response.
  • From: Scott Andrew <email@hidden>
  • Date: Sat, 19 Mar 2005 01:58:34 -0800

I am tyring to write some code that will parse XML that I have downloaded
form a secure server. The trick is I have to be logged into the server and
use cookies so I need to sue the NSMutableURLRequests so my cookies are
used.

NSString *urlString=[[NSString alloc]
initWithString:@"http://www.pbase.com/client?view=galleries";];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL
URLWithString:urlString]];

NSURLResponse* response;

NSData* result = [NSURLConnection sendSynchronousRequest:request
                                   returningResponse:&response
                                   error:&error];


CXMLTreeRef dataTree = CFXMLTreeCreateFromData (kCFAllocatorDefault,
                                                (CDataRef)result,
                                                 NULL,
                                                 kCFXMLParserSkipWhitespace,
                                                 kCFXMLNodeCurrentVersion)

My dataTree is NULL. I can convert my data to string and see the XML.
Getting the XML from a URL is not an option since I have to be logged into
the server with cookies.

The XML looks like so:

<?xml version="1.0" encoding="UTF-8"?>
<gallerylist>
<gallery>
  <id>2234164</id>
  <name>root</name>
  <title> Galleries</title>
  <public_flag>Y</public_flag>
</gallery>
</gallerylist>

Help please..

Scott Andrew

 _______________________________________________
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

  • Follow-Ups:
    • Re: Help with CFXMLTreeCreateFromData with an NSMutableURLRequest response.
      • From: Chris Parker <email@hidden>
    • Re: Help with CFXMLTreeCreateFromData with an NSMutableURLRequest response.
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Re: newbie memory issues continued
  • Next by Date: text selectable in NSTextField
  • Previous by thread: Re: newbie memory issues continued
  • Next by thread: Re: Help with CFXMLTreeCreateFromData with an NSMutableURLRequest response.
  • Index(es):
    • Date
    • Thread