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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:51:38+00:00 2026-06-11T14:51:38+00:00

I am new to using GDataXML to parse an xml file. I want to

  • 0

I am new to using GDataXML to parse an xml file.
I want to change the value of some intermediate xml tag in the file & write it back to the file.

Eg. I have following file..

<sheetData>
 <row r="7" spans="5:6" x14ac:dyDescent="0.25">
  <c r="E7" t="s">
   <v>0</v> 
  </c>
  <c r="F7" t="s">
    <v>1</v> 
  </c>
 </row>
 <row r="8" spans="5:6" x14ac:dyDescent="0.25">
  <c r="E8" t="s">
   <v>2</v> 
  </c>
  <c r="F8">
   <v>9890234654</v> 
  </c>
 </row>
</sheetData>

I want to update the value of phone no (‘9890234654’) to, say, 9503452366.
How can I do that using GDataXML in iOS ?(I am using xcode 4.3.2)

I coudn’t find any method to replace a tag value directly in the original xml tree.

Any help is appreciated.
Thank you.

  • 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-06-11T14:51:39+00:00Added an answer on June 11, 2026 at 2:51 pm

    Did you create the XML file/data? I suggest that you put namespace for the nodes so that they are easier to track. For example:

    <sheetData xmlns="http://mypage.net/sheetdata">
      <row r="7" spans="5:6" x14ac:dyDescent="0.25" xmlns="http://mypage.net/r7">
        <c r="E7" t="s">
          <v>0</v> 
        </c>
        <c r="F7" t="s">
          <v>1</v> 
        </c>
      </row>
      <row r="8" spans="5:6" x14ac:dyDescent="0.25" xmlns="http://mypage.net/r8">
        <c r="E8" t="s">
          <v>2</v> 
        </c>
        <c r="F8">
          <v>9890234654</v> 
        </c>
      </row>
    </sheetData>
    

    Having the namespaces in place, here’s a sample code to update the value:

    //The sample xml data is assigned to this NSData object: myXMLData
    //Create a GDataXMLDocument
    NSError *error = nil;
    GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:myXMLData options:0 error:&error];
    
    //build a namespace dictionary
    NSDictionary *ns = [NSDictionary dictionaryWithObjectsAndKeys:@"http://mypage.net/sheetdata", @"sd", @"http://mypage.net/r7", @"r7", "http://mypage.net/r8", @"r8", nil];
    
    //Now here are some codes to change the value
    NSError *err = nil;
    GDataXMLNode *row8 = [[doc nodesForXPath:@"//r8:row" namespace:ns error:&err] objectAtIndex:0];
    //Need to change value of second node
    GDataXMLNode *f8 = [[row8 children] objectAtIndex:1];
    GDataXMLNode *f8v = [[f8 children] objectAtIndex:0];
    f8v.stringValue = @"9503452366";
    
    //doc now has the xml with updated value. Just get the XML data, doc.XMLData, from it then convert it as you please
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new using JUnit. I want to test some classes that implements
Im new in using Django, and i want to know if there is some
I'm new using Boost serialization. I'm using xml serialization and the non intrusive version.
I want to mention that I'm new using sql developer and I'm trying to
I new to using ASP.net-mvc and would like some help. I created a web
I'm new using Doctrine2, where is the best place to write my custom function
I am using new facebook sdk 3.0 to send app request and some data
I'm new using the excellent stuff of css twitter bootstrap and having a problem,
I'm new using Yii framework. I show a list a checkbox. But it's not
I still new using Asp.net with vb.net Protected Sub login_Click(ByVal sender As Object, ByVal

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.