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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:26:44+00:00 2026-05-27T15:26:44+00:00

This is example of my XML file <head> <cat>some title here… <info>some info here

  • 0

This is example of my XML file

<head>
    <cat>some title here...
    <info>some info here
        <summary>bla bla bla</summary>
        <full>
        the full text here
        </full
    </info>
    </cat>
</head>

I’m using NSXMLParserDelegate method like this:

    -(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
    if (qName) {
        elementName = qName;
    }

    // If it's the start of the XML, remove everything we've stored so far
    if([elementName isEqualToString:@"head"])
    {
        [self emptyDataContext];
        return;
    }
    else if([elementName isEqualToString:@"bgimage"])
    {
enter code here
    }
    // Create a new Category
    else if ([elementName isEqualToString:@"cat"]) 
    {


//array catching the values 
    }

    else if ([elementName isEqualToString:@"info"])
    {
            [add addObject:currentElementValue];
    } 
    else if([elementName isEqualToString:@"summary"])
    {

    }
    else if([elementName isEqualToString:@"full"])
    {

     }
    else if([elementName isEqualToString:@"quote"])
    {
    }

if have an array that catching all the values from the current string using the following function:

    -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
    if (!currentElementValue) {
        // init the ad hoc string with the value     
        currentElementValue = [[[NSMutableString alloc] initWithString:string]autorelease];
    } else {
        // append value to the ad hoc string    
        [currentElementValue setString:string]; //appendString:string];
    }
   NSLog(@"Processing value for : %@", string);

}

for some reason the “cat” and the “info” are getting blank string …
I have used some NSlogging to figure it out and igot something like this:

2011-12-19 00:40:07.557 LAO[39912:bc03] Processing value for :

2011-12-19 00:40:07.557 LAO[39912:bc03] Processing value for :”some info title…”

2011-12-19 00:40:07.558 LAO[39912:bc03] Processing value for :

2011-12-19 00:40:07.559 LAO[39912:bc03] Processing value for :

2011-12-19 00:40:07.560 LAO[39912:bc03] Processing value for : “some info title…”

2011-12-19 00:40:07.560 LAO[39912:bc03] Processing value for : “some summary contact goes here….”
2011-12-19 00:40:07.560 LAO[39912:bc03] summary
2011-12-19 00:40:07.561 LAO[39912:bc03] Processing value for :

????
please help

  • 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-27T15:26:45+00:00Added an answer on May 27, 2026 at 3:26 pm

    The XML example you posted is not valid XML. Here is a valid example XML document.

    <head>
        <cat>
            <title>some title here...</title>
            <info>some info here...</info>
            <summary>bla bla bla</summary>
            <full>
                the full text here
            </full>
        </cat>
    </head>
    

    You can’t just throw out text and tags into one XML tag. For exmaple, this will not work:

    <info>Hello, World
        <tag>Hello</tag>
        <tag>World</tag>
    </info>
    

    To make this valid, you could do something like the following:

    <info>
        <text>Hello, World</text>
        <tag>Hello</tag>
        <tag>World</tag>
    </info>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have XML like this: <article> <title>Article 1 title</title> <text>Lorem ipsum...</text> <image>http://example.com/img_01.jpg</image> </article> <article>
Given this example XML file: <doc> <tag> Hello ! </tag> <tag> My name is
This is an example XML file that would come from the Android Client. <test>
I've been racking my head with this... I've got a localized strings.xml file in
I am including a js file via the layout xml: for example: <reference name=head>
I'm using PHP to output data from a sports XML file (in this example
This is an example xml from MSDN <?xml version=1.0?> <!-- A fragment of a
So, this example comes right from MSDN. http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.readelementcontentasbase64.aspx Pretty much the only thing I
For example i have this xml. I need to get value of parameter val
For example, In this document < ?xml version=1.0 ? > < SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/

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.