Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 431551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:59:10+00:00 2026-05-12T19:59:10+00:00

Ok, I am back on this task. I have my XML properly download from

  • 0

Ok, I am back on this task. I have my XML properly download from my webserver with a URL pointing to the server’s file, however, when I detect the network is ‘unreachable’ I simply point the URL to my application’s local XML and I get the following error (N.B. the file is a direct copy of the one on the server).

I cannot find detail description, but I think it is saying that the URL is pointing to an inaccessible location. Am I storing this resource in the wrong location? I think I want it in the HomeDirectory / Library??

Debug output

loadMyXml: /var/mobile/Applications/950569B0-6113-48FC-A184-4F1B67A0510F/MyApp.app/SampleHtml.xml
2009-10-14 22:08:17.257 MyApp[288:207] Wah! It didn't work. Error Domain=NSXMLParserErrorDomain Code=5 "Operation could not be completed.   (NSXMLParserErrorDomain error 5.)" 
2009-10-14 22:08:17.270 MyApp[288:207] Operation could not be completed. (NSXMLParserErrorDomain error 5.)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:59:10+00:00Added an answer on May 12, 2026 at 7:59 pm

    According to Dave DeLong,

    That means it’s having issues parsing your file.

    I think it may be the XSLT reference in the XML – as it points to the webserver. I will review and get back to this question with an improved answer.

    It was the path of the file. My code wasn’t even close to the right location — and I was missing a trailing letter ‘s’. The error code definition implies a “premature end of file”, which caused me to truncate my file without any success. I then went back to basics and iterated on the file system to look for my file.

    I debugged by using the NSFileManager to iterate to my file and then verified that it was loadable with the contentsAtPath method. I was able to dump it with NSLog(). Once I was convinced that the file was well-formed and loaded in raw form, I made certain that my NSURL was constructed with the same syntax and methods. Then it loaded correctly. Now I can load either a network file “full-featured” content or a local “sample” content.

    NSDirectoryEnumerator *dirEnumerator = [[NSFileManager defaultManager] enumeratorAtPath: NSHomeDirectory()];
    NSString *something;
    NSString *f;
    
    while( something = [dirEnumerator nextObject] ) {
        f = [[[NSString alloc] initWithFormat: @"%@/%@", NSHomeDirectory(), something] autorelease];
        if( [f hasSuffix :@"two_cookies.xml"] ){
        NSData *nsData = (NSData*) [[NSFileManager defaultManager] contentsAtPath: f];
            NSLog(@"%@", nsData );
        }
    }
    

    Output

    2009-10-22 00:47:40.147 MyApp[13843:20b] <?xml version="1.0" encoding="iso-8859-1"?>
    

    P.S. I hope my being explicit here is helpful to others as they debug their data processing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to complete this task: I'm given a xml file which is exported
We have a Java server back-end that uses Apache XML-RPC to make its services
I little while back I posted this question . I have updated that question
I have a fabric task set up like this: @task def cli(): command =
I have a lot of trouble to accomplish this task on an ipad :
I have a WCF application that at present is using XML based file storage
I have this task that needs investigation as to why the md5 value of
I have created a custom listview that is populated using a row.xml file. Each
I posted this back in May on the [android-developers] Google Group. I never heard
I've always done this back asswards in PHP or ASAP, so I figure it's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.