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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:16:12+00:00 2026-05-28T18:16:12+00:00

I am writing an iPhone application that will be used to find the line

  • 0

I am writing an iPhone application that will be used to find the line information at local bars/social spots. In the application, I parse an XML file from a web server. Here is the structure of the XML:

<?xml version="1.0" encoding="UTF-8"?>
<Bars>
    <Bar>Kam's</Bar>
    <Line>10</Line>
    <Bar>Cly's</Bar>
    <Line>10</Line>
    <Bar>Joe's</Bar>
    <Line>10</Line>
    <Bar>The Red Lion</Bar>
</Bars>

This data is then displayed in a tableview with the Bar and the Line shown. If a user selects an element in the table, a uiactionview appears and requests for the user to update the line information for that particular bar. I know how to take the users input.

The problem I am having, and I really don’t know where to begin, is figuring out how to rewrite the XML and put it back in the same location on the web server. Does anyone know of a tutorial or could possibly get me started with this?

Thanks so much.

  • 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-28T18:16:15+00:00Added an answer on May 28, 2026 at 6:16 pm

    So I’ll answer your direct question, but I have to mention that what you’ve posted is not proper XML. The line numbers should be attributes, or sub-nodes of the Bar nodes. Either of the following would be considered correct:

    <?xml version="1.0" encoding="UTF-8"?>
    <Bars>
        <Bar line="10">Kam's</Bar>
        <Bar line="10">Cly's</Bar>
        <Bar line="10">Joe's</Bar>
        <Bar line="10">The Red Lion</Bar>
    </Bars>
    

    or

    <?xml version="1.0" encoding="UTF-8"?>
    <Bars>
        <Bar>
            <name>Kam's</name>
            <line>10</line>
        </Bar>
        <Bar>
            <name>Cly's</name>
            <line>10</line>
        </Bar>
        <Bar>
            <name>Joe's</name>
            <line>10</line>
        </Bar>
        <Bar>
            <name>The Red Lion</name>
            <line>10</line>
        </Bar>
    </Bars>
    

    There are even more ways to represent it, but the XML spec does not honor node ordering. A parser will generally order them first to last, but there’s no guarantee, so your Line nodes may get associated with the wrong Bar.

    Anyway, that said, you need a few different tools, and they are far too many details to write out in an answer here so I’ll point you to the documentation.

    1) To communicate with the server (either get the XML, or retrieve it) you’ll probably want to use NSURLConnection. Here’s Apple’s tutorial on it.

    2) For parsing the XML, Apple only supplies a SAX parser. It’s going to be a steep learning curve for you, and it also cannot write XML, which you need to do. I’m going to direct you to this other StackOverflow post, since it goes into more detail about finding a good 3rd party XML parser.

    3) If you don’t know how to set up a server that can serve an XML document, and accept POSTed XML content, that’s a whoooole other bag of worms. I would suggest you start with a simple “LAMP” stack, and read up on PHP.

    Cheers!

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

Sidebar

Related Questions

I'm writing an iPhone application and I find that there are three controllers in
I'm developing an iPhone application that will access XML files (or something similar) from
I'm writing a C# winforms application that will transfer files from an iPhone or
I'm writing an iPhone application that needs to send small bits of information (two
I am writing an iPhone application that needs to record audio from the built-in
I am writing an iPhone application and I have a table view that is
I'm writing an iphone application and need to show a progress bar that shows
I've been writing a Web Application recently that interacts with iPhones. The iPhone iphone
I'm writing an application for the iPhone that communicates with a SQLite database but
I'm writing an iphone application that pulls xlsx file from the server, manipulates with

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.