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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:13:42+00:00 2026-06-14T14:13:42+00:00

dear friend i want parse the element using attributes in xml parser this is

  • 0

dear friend i want parse the element using attributes in xml parser this is my xml format

<LOB>Cars</LOB>
<PPL>Indica</PPL>
<REGION>West2</REGION>
<RETAIL>30</RETAIL>
<LOB>Cars</LOB>
<PPL>Indica</PPL>
<REGION>West1</REGION>
<RETAIL>175</RETAIL>
<LOB>Cars</LOB>
<PPL>Indica Vista</PPL>
<REGION>West2</REGION>
<RETAIL>267</RETAIL>
<LOB>Cars</LOB>
<PPL>Indica Vista</PPL>
<REGION>West1</REGION>
<RETAIL>1212</RETAIL>

 more.....


<LOB>PCV - Venture</LOB>
<PPL>Venture</PPL>
<REGION>West2</REGION>
<RETAIL>2</RETAIL>
<LOB>PCV - Venture</LOB>
<PPL>Venture</PPL>
<REGION>West1</REGION>
<RETAIL>12</RETAIL>

 more....

now i want only cars retail count but here PCV-Venture attributes also in a same xml file so what can i do only for attribute is cars then parse retail element not for PCV – Venture’s?

  • 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-14T14:13:43+00:00Added an answer on June 14, 2026 at 2:13 pm

    Use TBXML parsing to parse xml format data.

    link TBXML

    data should be in this format

    <info>
    <User>
    <CountryId>13</CountryId>
    <CountryName>Austrlia</CountryName>
    </User>
    <User>
    <CountryId>12</CountryId>
    <CountryName>India</CountryName>
    </User>
    <User>
    <CountryId>17</CountryId>
    <CountryName>test1</CountryName>
    </User>
    <User>
    <CountryId>16</CountryId>
    <CountryName>UK</CountryName>
    </User>
    </info>  
    

    and parse as

    TBXML * tbxml = [TBXML tbxmlWithURL:[NSURL URLWithString:url]];
    
        TBXMLElement *rootXMLElement = tbxml.rootXMLElement;
    
        if (rootXMLElement)
        {
            TBXMLElement * user = [TBXML childElementNamed:@"user" parentElement:rootXMLElement];
    
    
            while (user != nil)
            {
    
                TBXMLElement *CountryId = [TBXML childElementNamed:@"CountryId" parentElement:user];
                if (CountryId != nil)
                {
                    NSLog(@"CountryId :: %@", [TBXML textForElement:CountryId]);
                }
    
                TBXMLElement *CountryName = [TBXML childElementNamed:@"CountryName" parentElement:user];
                if (CountryName != nil)
                {
                    NSLog(@"CountryName :: %@", [TBXML textForElement:CountryName]);
                }
    
                user = [TBXML nextSiblingNamed:@"user" searchFromElement:user];
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear friends,I want to extract text 平均3.6 星 from this code segment excerpted from
Dear fellow homo sapiens, I've created this graph using the code below (except without
dear all i want to know how to submit asp.net form data using jquery
Dear all,Now i have this question in my java program,I think it should be
Dear members of the Stackoverflow community, We are developing a web application using the
For example I have the text. $text = 'Hello dear friend, my name is
hi my dear friends : how can i get href attrib of anchor element
I want to make email templates in Zend Framework. For example, <html> <body> Dear
Dear Friends good afternoon. My problem may be this is very basic one i.e.
Dear stackoverflow members, I have a small problem, I want to replace some characters

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.