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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:15:04+00:00 2026-06-16T01:15:04+00:00

I want to modify xml attribute using objective c on some action for example,

  • 0

I want to modify xml attribute using objective c on some action
for example, i have button on screen and my xml tag is

mynode attribute1=”” attribute2=”” attribute3=””
/mynode

if initial value of attribute3 is NO, on tapping button i want to change it to YES and write it to xml file which is in projects directory.
Please help me if anyone know about this.
I have tried using GDataXML addattribute method, but not able to modify tag.

  • 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-16T01:15:06+00:00Added an answer on June 16, 2026 at 1:15 am

    It is not possible to edit the XML file in Objective – c. If you want to do this, then you needs to create your own xml file or you can append the tags to the existing xml.
    Please refer the following code where I am created my own xml to append the bytes array of a image & adding it to the original xml.

    //Encode all the data and get the XML string 
                NSString *theXML = [[NSString alloc] 
                                    initWithBytes: [clipSvgData bytes] 
                                    length:[clipSvgData length] 
                                    encoding:NSUTF8StringEncoding];
    
                //Returns the substring of an main xml file by excluding the extra xml tags
                NSString *startTag = @"<svg";
                NSString *endTag = @"</svg>";
                NSString *responseString;
    
                NSScanner *scanner = [[NSScanner alloc] initWithString:theXML];
                [scanner scanUpToString:startTag intoString:nil];
                scanner.scanLocation += [startTag length];
                [scanner scanUpToString:endTag intoString:&responseString];
                [scanner release];
    
                //Remove the SVG tag from main xml
                NSString *startTag1 = @">";
                NSString *endTag1 = @"</svg>";
                NSString *responseString1;
    
                NSScanner *scanner1 = [[NSScanner alloc] initWithString:[NSString stringWithFormat:@"<svg %@ </svg>",responseString]];
                [scanner1 scanUpToString:startTag1 intoString:nil];
                scanner1.scanLocation += [startTag1 length];
                [scanner1 scanUpToString:endTag1 intoString:&responseString1];
                [scanner1 release];
    
        NSString *strSVGNode = [NSString stringWithFormat:@"<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"%fpx\" y=\"%fpx\" width=\"%fpx\" height=\"%fpx\" viewBox=\"0 0 141.73 141.73\" enable-background=\"new 0 0 141.73 141.73\"  xml:space=\"preserve\" preserveAspectRatio=\"none\">", imgXPos, imgYPos, imgWidth, imgHeight];
    
        NSString *strClipXml = [NSString stringWithFormat:@"%@ %@ </svg></g>",strSVGNode ,responseString1];
    
        //Add the created SVG as new node in main SVG file.
        GDataXMLNode *clipNode = [GDataXMLNode textWithStringValue:[NSString stringWithFormat:@"%@",strClipXml]];
        [xmlDocument.rootElement addChild:clipNode];
    

    You can modify it as per your requirement.

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

Sidebar

Related Questions

I'm trying to programatically modify some XML elements using PHP. They have the form
I want to modify some data on XML file residing on server side by
I have an xml file I need to modify: ... </web-app> I want to
I want to modify all the text nodes using some functions in C#. I
I have a xml file which I want to edit using automatic data binding
I want to modify an existing XML file using xPath. If the node doesn't
I have an XML document that I want to modify the connectionstrings to. How
I want to modify xml file using dom ,but when I make node.getNodeValue(); it
I have a XML where I only want to modify a specific section, and
I want to modify some code in the Eclipse JDT itself (In the Debug

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.