Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Bars&gt; &lt;Bar line="10"&gt;Kam's&lt;/Bar&gt; &lt;Bar line="10"&gt;Cly's&lt;/Bar&gt; &lt;Bar line="10"&gt;Joe's&lt;/Bar&gt; &lt;Bar line="10"&gt;The Red Lion&lt;/Bar&gt; &lt;/Bars&gt; </code></pre> <p>or</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Bars&gt; &lt;Bar&gt; &lt;name&gt;Kam's&lt;/name&gt; &lt;line&gt;10&lt;/line&gt; &lt;/Bar&gt; &lt;Bar&gt; &lt;name&gt;Cly's&lt;/name&gt; &lt;line&gt;10&lt;/line&gt; &lt;/Bar&gt; &lt;Bar&gt; &lt;name&gt;Joe's&lt;/name&gt; &lt;line&gt;10&lt;/line&gt; &lt;/Bar&gt; &lt;Bar&gt; &lt;name&gt;The Red Lion&lt;/name&gt; &lt;line&gt;10&lt;/line&gt; &lt;/Bar&gt; &lt;/Bars&gt; </code></pre> <p>There are even more ways to represent it, but the XML spec does <em>not</em> honor node ordering. A parser will generally order them first to last, but there's no guarantee, so your <code>Line</code> nodes may get associated with the wrong <code>Bar</code>.</p> <p>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.</p> <p>1) To communicate with the server (either get the XML, or retrieve it) you'll probably want to use NSURLConnection. <a href="http://developer.apple.com/library/IOs/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/10000165i" rel="nofollow noreferrer">Here's Apple's tutorial on it</a>.</p> <p>2) For <em>parsing</em> the XML, Apple only supplies a <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/XMLParsing/XMLParsing.html" rel="nofollow noreferrer">SAX parser</a>. 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 <a href="https://stackoverflow.com/questions/4181690/choosing-the-right-ios-xml-parser">this other StackOverflow post</a>, since it goes into more detail about finding a good 3rd party XML parser.</p> <p>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.</p> <p>Cheers!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload