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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:03:14+00:00 2026-05-25T10:03:14+00:00

I am parsing a xml file which giving an error NSXMLParserErrorDomain error 41 Will

  • 0

I am parsing a xml file which giving an error

NSXMLParserErrorDomain error 41

Will anyone tell me what is the reason of this error and how to solve this error.

Thank in Advance.

XML File Is Like

 <GetOpenQuestionsForUserResult>
 <Questions Count="2">
 <Question id="44">
 <Question Title>test for mitesh</Question Title>
 <Question Description>please respond from mobile</Question Description>
 <Creator Name>test@abc.com</Creator Name>
 <Creation Date>08/29/2011</Creation Date>
 <Respondent Names>test@abc.com</Respondent Names>
 <Anonymous Answers>Yes</Anonymous Answers>
 <Expiry Date>08/29/2011</Expiry Date>
 </Question>

 <Question id="45">
 <Question Title>test for mitesh 2</Question Title>
 <Question Description>second question for mitesh mobile</Question Description>
 <Creator Name>test1@abc.com</Creator Name>
 <Creation Date>08/29/2011</Creation Date>
 <Respondent Names>test1@abc.com</Respondent Names>
 <Anonymous Answers>Yes</Anonymous Answers>
 <Expiry Date>08/31/2011</Expiry Date>
 </Question>
 </Questions>
 </GetOpenQuestionsForUserResult>
 </GetOpenQuestionsForUserResponse>

Please Tell Me How to parse This xml File

I did Following Code for parsing

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName 
attributes:(NSDictionary *)attributeDict {


if([elementName isEqualToString:@"Question"]) 
{
    [QuesIdArray addObject: [attributeDict objectForKey:@"id"]];
}
   else if([elementName isEqualToString:@"Question Title"]) 
{

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

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

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

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

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

}

else if([elementName isEqualToString:@"Expiry Date"]) 
{

}

  }

   - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { 

if(!currentElementValue) 
    currentElementValue = [[NSMutableString alloc] initWithString:string];
else
    [currentElementValue appendString:string];


NSLog(@"Processing Value: %@", currentElementValue);


  }



   - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {

if(currentElementValue) 
    currentElementValue = [currentElementValue stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];

if([elementName isEqualToString:@"Error"]) 
{

    //appDelegate.ErrorString = [ [ NSString alloc ] initWithString: currentElementValue ] ;
}

else if([elementName isEqualToString:@"Question Title"]) 
{

    [QuesTitleArray addObject:currentElementValue];
}
else if([elementName isEqualToString:@"Question Description"]) 
{

    [QuesTextArray addObject:currentElementValue];
}
else if([elementName isEqualToString:@"Creator Name"]) 
{
    [QuesCreatorArray addObject:currentElementValue];
}
else if([elementName isEqualToString:@"Creation Date"]) 
{
    [QuesCreationDateArray addObject:currentElementValue];
}
else if([elementName isEqualToString:@"Respondent Names"]) 
{
    [ResNamesArray addObject:currentElementValue];
}
else if([elementName isEqualToString:@"Anonymous Answers"]) 
{
    [QuesAnswerArray addObject:currentElementValue];
}

else if([elementName isEqualToString:@"Expiry Date"]) 
{

    [QuesExpiryDateArray addObject:currentElementValue];
}

//[currentElementValue release];

currentElementValue = nil;
}

can Anyone tell me what mistake i done here.
It giving an error: NSXMLParserErrorDomain error 41

  • 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-25T10:03:15+00:00Added an answer on May 25, 2026 at 10:03 am

    From NSXMLParser reference – 41 error code value is NSXMLParserAttributeHasNoValueError

    The problem is that your xml is malformed as xml tag names cannot contain spaces. For example

    <Question Title>...
    

    Here tag name is ‘Question’ and ‘Title’ is interpreted as attribute name, which has no value. You should correct your xml to fix that (i.e. remove spaces in tag names).

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

Sidebar

Related Questions

I got a string from parsing a XML file which looks like this: Fri,
hi friends i'm using Sax parser for parsing my xml file which i recieve
I'm trying to read in an xml file which looks like this <?xml version=1.0
I'm parsing big XML file with XPathExpression selection for some nodes existing at various
I am parsing a XML file in Java using the W3C DOM. I am
What is the fastest method of parsing an XML file in C#? I'm using
I am parsing some XML something like this: <root> <some_gunk/> <dupe_node> ... stuff I
I need to parse a xml file which is practically an image of a
I have a large XML file which in the middle contains the following: <ArticleName>Article
I have sample code written for parsing xml file using javax.xml package. it uses

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.