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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:21:19+00:00 2026-06-02T20:21:19+00:00

I am trying to parse xml using the touchXML library but not getting the

  • 0

I am trying to parse xml using the touchXML library but not getting the results, the code is as below

NSError *error = nil;    
CXMLDocument *xmlParser = [[CXMLDocument alloc] initWithXMLString:dataString options:0 error:&error];

NSArray *resultNodes = NULL;
resultNodes = [xmlParser nodesForXPath:@"//entry" error:&error];

for (CXMLElement *resultElement in resultNodes) {
    NSMutableDictionary *blogItem = [[NSMutableDictionary alloc] init];

    int counter;

    for(counter = 0; counter < [resultElement childCount]; counter++) {
        [blogItem setObject:[[resultElement childAtIndex:counter] stringValue] forKey:[[resultElement childAtIndex:counter] name]];
    }        
} 

the method nodesForXPath: doesn’t returns anything leaving the resultNodes array with 0 objects. I am getting the proper xml in dataString and the CXMLDocument is also getting prepared properly. I tried debugging it but there is nothing I can see accept the 0 objects in resultNodes, NSError also contains nothing (i.e. no error occurs). the xml file I am trying to parse is as below.

<feed xmlns:s="http://syndication.nhschoices.nhs.uk/services" xmlns="http://www.w3.org/2005/Atom">
<title type="text">...</title>
<id>...</id>
<rights type="text">© Crown Copyright 2009</rights>
<updated>2012-04-27T11:33:02+01:00</updated>
<category term="Search"/>
<logo>...</logo>
<author>...</author>
<s:SearchCoords>174900,517900</s:SearchCoords>
<entry>
    <id>
        http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/32248
    </id>
    <title type="text">Sayer A</title>
    <updated>2012-04-27T10:33:02Z</updated>
    <link rel="self" title="Sayer A" href="http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/32248?apikey=YAHUGHET"/>
    <link rel="alternate" title="Sayer A" href="http://www.nhs.uk/ServiceDirectories/Pages/GP.aspx?pid=15F37AEF-EC5B-4A90-9E72-269ADEB39629"/>
    <content type="application/xml">
        <s:organisationSummary>
            <s:name>Sayer A</s:name>
            <s:address>
                <s:addressLine>The Richmond Green Medical Cen</s:addressLine>
                <s:addressLine>19 The Green</s:addressLine>
                <s:addressLine>Richmond</s:addressLine>
                <s:addressLine>Surrey</s:addressLine>
                <s:postcode>TW91PX</s:postcode>
            </s:address>
            <s:contact type="General">
                <s:telephone>020 83327515</s:telephone>
            </s:contact>
            <s:geographicCoordinates>
                <s:northing>174900</s:northing>
                <s:easting>517800</s:easting>
                <s:longitude>-0.305512266736965</s:longitude>
                <s:latitude>51.4608026642546</s:latitude>
            </s:geographicCoordinates>
            <s:Distance>0.1</s:Distance>
        </s:organisationSummary>
    </content>
</entry>
<entry>
    <id>
        http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/33420
    </id>
    <title type="text">Griffiths W</title>
    <updated>2012-04-27T10:33:02Z</updated>
    <link rel="self" title="Griffiths W" href="http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/33420?apikey=YAHUGHET"/>
    <link rel="alternate" title="Griffiths W" href="http://www.nhs.uk/ServiceDirectories/Pages/GP.aspx?pid=EEC98A8A-B888-4F44-A0B6-DC6ABCBF19CE"/>
    <content type="application/xml">
        <s:organisationSummary>
            <s:name>Griffiths W</s:name>
            <s:address>
                <s:addressLine>Paradise Road Surgery</s:addressLine>
                <s:addressLine>37 Paradise Road</s:addressLine>
                <s:addressLine>Richmond</s:addressLine>
                <s:addressLine>Surrey</s:addressLine>
                <s:postcode>TW91SA</s:postcode>
            </s:address>
            <s:contact type="General">
                <s:telephone>020 89402423</s:telephone>
            </s:contact>
            <s:geographicCoordinates>
                <s:northing>174800</s:northing>
                <s:easting>518100</s:easting>
                <s:longitude>-0.301388352909701</s:longitude>
                <s:latitude>51.4601120315006</s:latitude>
            </s:geographicCoordinates>
            <s:Distance>0.223606797749979</s:Distance>
        </s:organisationSummary>
    </content>
</entry>
<entry>
    <id>
        http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/33035
    </id>
    <title type="text">Dr Da Costa</title>
    <updated>2012-04-27T10:33:02Z</updated>
    <link rel="self" title="Dr Da Costa" href="http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/33035?apikey=YAHUGHET"/>
    <link rel="alternate" title="Dr Da Costa" href="http://www.nhs.uk/ServiceDirectories/Pages/GP.aspx?pid=EDCE215D-6412-4AAB-AFC4-9F37888D413C"/>
    <content type="application/xml">
        <s:organisationSummary>
            <s:name>Dr Da Costa</s:name>
            <s:address>
                <s:addressLine>The Vineyard Surgery</s:addressLine>
                <s:addressLine>35 The Vineyard</s:addressLine>
                <s:addressLine>Richmond</s:addressLine>
                <s:addressLine>Surrey</s:addressLine>
                <s:postcode>TW106PP</s:postcode>
            </s:address>
            <s:contact type="General">
                <s:telephone>020 89480404</s:telephone>
            </s:contact>
            <s:geographicCoordinates>
                <s:northing>174600</s:northing>
                <s:easting>518100</s:easting>
                <s:longitude>-0.301044685875553</s:longitude>
                <s:latitude>51.4581333717098</s:latitude>
            </s:geographicCoordinates>
            <s:Distance>0.360555127546399</s:Distance>
        </s:organisationSummary>
    </content>
</entry>
  • 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-02T20:21:22+00:00Added an answer on June 2, 2026 at 8:21 pm

    I’ve never worked with touchXML, but it may be that you need to set your namespace, like here: Getting the value of an Element in Cocoa using TouchXML

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

Sidebar

Related Questions

I'm trying to parse an XML file using PHP, but I get an error
I am trying to parse XML with Python but not getting very far. I
I'm trying to parse an xml file with PHP. I'm using this code and
I am trying to parse an xml file using XmlReader but although I am
I'm able to successfully parse the contents of a XML file using TouchXML, but
I am trying to parse a XML document using Xerces, but I cant seem
Hi guys I'm trying to parse an xml document using jquery but i keep
I'm trying to parse an xml file using XML::Simple library. In a designed way
I'm trying to parse a XML using Apache Commons JXPath. But for some reason,
Am trying to parse the below xml using TBXML. I want to create an

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.