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 7592937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:02:10+00:00 2026-05-30T21:02:10+00:00

As the google doc is not available anymore, I’m lost with those concepts. What

  • 0

As the google doc is not available anymore, I’m lost with those concepts.

What is a node, and what is an element (that inherits the node) ?

How can I switch from nodes to elements. I mean, for example, if I write :

NSError* error;
NSData* xmlData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ForTesting" ofType:@"xml"]];

error = nil;
GDataXMLDocument* XMLDoc = [[[GDataXMLDocument alloc] initWithData:xmlData options:0 error:&error] autorelease];
if (XMLDoc == nil) {
    NSLog(@"%@", error.description);
    return;
}

GDataXMLNode* xmlElement = [[XMLDoc nodesForXPath:@"//root/fileVersion" error:nil] objectAtIndex:0];
NSString* fileVersion = xmlElement.stringValue;

GDataXMLNode* xmlList = [[XMLDoc nodesForXPath:@"//root/list" error:nil] objectAtIndex:0];  // single item

After that code, how can I write something like that to switch to GDataXMLElement instead of continuing with GDataXMLNode, that would requires me to continue using XPath (I don’t want to use it past that point) :

// code don't work : elementsForName is not defined for GDataXMLNode
for (GDataXMLElement* xmlObject in [xmlList elementsForName:@"object"]) {
    MyClass* obj = [[[MyClass alloc] initWithXMLElement:xmlObject] autorelease];
}
  • 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-30T21:02:11+00:00Added an answer on May 30, 2026 at 9:02 pm

    GDataXMLNode is obviously the classes you use for XML parser- GDataXMLNode.h/.m

    In the code you have given returns an array. You can use.

    NSArray *myArray = [XMLDoc nodesForXPath:@”//root/fileVersion” error:nil];

    You can iterate myArray like this.

    for (GDataXMLElement *nodeXmlElt in myArray)
    {
        //some code
    }
    

    Each of my nodeXmlElt will be like given below.

    <fileVersion>
    <title>San Francisco CBS News</title>
    <link>http://news.google.com/news/</link>
    <fileVersion>
    
    //getting title
    NSArray *elementArray = [nodeXmlElt elementsForName:@"title"];
    GDataXMLElement *gdataElement = (GDataXMLElement *)[elementArray objectAtIndex:0];
    NSString *title = gdataElement.stringValue; //returns 'San Francisco CBS News'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I opened a google doc, it seems that the google doc is not a
I really try to find on google how can we convert .doc and .txt
Im working on some google doc spread sheets and I thought im not sure
As is mentioned in the doc for google app engine, it does not support
As Google Translate API is not free anymore, I try to get the translations
Going through this tutorial https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC it is mentioned that to set up a call
I have a google doc spreadsheet that contains information on every member of a
it seems that the google doc/wiki is difficult if i code it from the
Seeking help to design a layout as shown here: http://docs.google.com/Doc?docid=0AQhgDtGvE2HgZGZ6cmtua185MTd0eGdyZmc&hl=en The major challenge I
UPDATE : GWT 2.3 introduces a better mechanism to fight XSRF attacks. See http://code.google.com/webtoolkit/doc/latest/DevGuideSecurityRpcXsrf.html

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.