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

  • Home
  • SEARCH
  • 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 7032549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:56:59+00:00 2026-05-28T00:56:59+00:00

I am completely baffled by this as I have coded several other methods using

  • 0

I am completely baffled by this as I have coded several other methods using TBXML to properly parse an XML file. Below is the method in question. The root element remains null no matter what I try therefore the rest of the method fails. As you can see, the XML file is located on the web being output via PHP. I’ve used this exact same method in another application with no trouble whatsoever. I’ve compared the XML output to what I previously used and see no differences other than elements. The code for this method is almost identical but I must be missing something. Any help would be greatly appreciated.

- (void)loadFromZenPhoto{
tbxml = [[TBXML alloc] initWithURL:[NSURL URLWithString:@"http://www.flpublicarchaeology.org/civilwar/generatexml.php"]];    

// Obtain root element
TBXMLElement *root = tbxml.rootXMLElement;

// if root element is valid
if (root) {
    TBXMLElement *site = [TBXML childElementNamed:@"site" parentElement:root];

    // if a site element was found, create site object
    while (site != nil) {

        Site *aSite = [[Site alloc] init];

        TBXMLElement *siteid = [TBXML childElementNamed:@"id" parentElement:site];
        if (siteid != nil)
            aSite.siteid = [[TBXML textForElement:siteid] intValue];

        TBXMLElement *parentid = [TBXML childElementNamed:@"parentid" parentElement:site];
        if (parentid != nil)
            aSite.parentid = [[TBXML textForElement:parentid] intValue];

        TBXMLElement *folder = [TBXML childElementNamed:@"folder" parentElement:site];
        if (folder != nil)
            aSite.folder = [TBXML textForElement:folder];

        TBXMLElement *title = [TBXML childElementNamed:@"title" parentElement:site];
        if (title != nil)
            aSite.title = [TBXML textForElement:title];        


        // add site object to the sites array
        [sites addObject:aSite];

        //advance to next sibling
        site = [TBXML nextSiblingNamed:@"site" searchFromElement:site];
    }           
}
}
  • 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-28T00:57:00+00:00Added an answer on May 28, 2026 at 12:57 am

    Ok, I think you are facing the same problem that I had before. I guess the problem is you fixed the semantic issues in TBXML.m by XCode suggestions. Please this answer for more info.

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

Sidebar

Related Questions

Completely new to using simple XML library in PHP, and have been using the
I am having trouble getting NCover to properly cover a .dll. I have several
I am completely baffled by this and don't fully understand IE7's problem. The page
This is super simple and I'm completely baffled by this behavior. I want my
Specifically a Multigraph . Some colleague suggested this and I'm completely baffled. Any insights
Ok, I am completely baffled. I am setting up an OO site. I have
I've been working on this file for awhile and I'm just really baffled. I
Edit: Answered my own question. See below. -_- I have a variable defined in
For some reason, the retain/release behavior in the following code has me completely baffled.
Right... this one had me baffled for a while today so maybe one of

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.