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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:16:46+00:00 2026-05-25T17:16:46+00:00

I am new in android development.i send you xml file,it contain some html tag.that

  • 0

I am new in android development.i send you xml file,it contain some html tag.that is follows-
How i parse text,image.
XMLFILE-

<NewDataSet>
<Table><Cat_id>1</Cat_id><Cat_Parentid>0</Cat_Parentid><Cat_Name>News for the day</Cat_Name><Cat_Desc><div style="text-align: center;"><span class="Apple-style-span" style="font-weight: normal; font-size: medium; "></span></div><span class="Apple-style-span" style="color: rgb(105, 105, 105); font-family: Verdana; font-size: 13px; font-weight: normal; "><br><div style="text-align: center;">Yes we are coming at E & I? Are you?</div></span><br><h1 style="font-weight: bold; "><span style="font-family: Verdana; font-size: 14pt; ">News for the day...</span></h1><span style="color: rgb(105, 105, 105); "><span style="font-family: Tahoma; font-size: 10pt; ">Template Mobile Sites for IC: <a href="http://icmobilesite.zapak_vi.net/">http://icmobilesite.zapak_vi.net/</a></span><br><span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px; color: rgb(105, 105, 105); ">Promotional valid till 30 Sept 2011: MOBILE WEBSITE (Base Product Mobile CMS) for JUST $159<br></span></span><br><span style="font-family: Tahoma; font-size: 10pt; color: rgb(105, 105, 105); ">Mobile Template link: </span><a href="http://icmobilesite.zapak_vi.net/"><span class="Apple-style-span" style="font-size: 15px; font-family: Calibri, sans-serif; color: rgb(105, 105, 105); ">http://newsletter.zapak_vi.net/Mobilesite/</span><br></a><span style="font-size: 10pt; font-family: Tahoma; "><span style="font-size: 10pt; "><br><span style="color: rgb(105, 105, 105); ">With the promotion on Business Edge and eFusion still running successful in e market place - $ 499</span><br><span style="color: rgb(105, 105, 105); ">Check out some of the latest site launch on: </span><br><br><span style="color: rgb(105, 105, 105); font-weight: bold; ">http://www.randallcontracting.co.uk/Pages/Default.aspx </span><br><br><span style="color: rgb(105, 105, 105); font-size: 10pt; "><span style="font-weight: bold; ">Category</span>: Building & Construction</span><br></span><br></span><div style="color: rgb(105, 105, 105); text-align: left; "><span style="font-size: 10pt; font-family: Tahoma; ">Description: WELCOME TO RANDALL CONTRACTING Randall Contracting is a family-run contracting SME which has been servicing London and the South East since 1956. Working closely with our Clients and external Design Consultants, we place great emphasis on a safe, positive, practical and common sense approach to our projects. Our delivery methods have resulted in an extensive volume of repeat business from both Private and Public Sectors. Safety and Environmental concerns are a high priority on all our contracts and we continually strive to source innovative working methods and solutions. Our equipment is regularly updated and maintained to ensure minimal environmental impact.</span><br><br></div><span style="color: rgb(105, 105, 105); font-weight: bold; font-family: Tahoma; "><span style="font-size: 10pt; "><br></span></span><br></Cat_Desc><Cat_Active>true</Cat_Active><Cat_SortOrder>1</Cat_SortOrder><langid>1</langid><proCatImage>1bag6.jpg</proCatImage><bigimage>no-img.gif</bigimage></Table>
<NewDataSet>

END OF FILE

  • 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-25T17:16:47+00:00Added an answer on May 25, 2026 at 5:16 pm

    That same thing i done with parsing.

    XML Handler class-

    class xmlHandler extends DefaultHandler {
        private Vector nodes = new Vector();
        private Stack tagStack = new Stack();
    
        public void startDocument() throws SAXException {
        }
    
        public void startElement(String uri, String localName, String qName,
                Attributes attributes) throws SAXException {
            // System.out.println("1");
            if (qName.equals("clause")) {
                Noden node = new Noden();
                nodes.addElement(node);
                // System.out.println("2");
            }
            // System.out.println("3");
            tagStack.push(qName);
        }
    
        public void characters(char[] ch, int start, int length)
                throws SAXException {
            String chars = new String(ch, start, length).trim();
    
            if (chars.length() > 0) {
                String qName = (String) tagStack.peek();
                Noden currentnode = (Noden) nodes.lastElement();
                // System.out.println(qName);
    
                if (qName.equals("en")) {
                    currentnode.setEn(chars);
                } else if (qName.equals("alt")) {
                    currentnode.setAlt(chars);
                }
            }
        }
    
        public void endElement(String uri, String localName, String qName,
                Attributes attributes) throws SAXException {
            tagStack.pop();
        }
    
        public void endDocument() throws SAXException {
            StringBuffer result = new StringBuffer();
            for (int i = 0; i < nodes.size(); i++) {
                Noden currentnode = (Noden) nodes.elementAt(i);
                result.append("En : " + currentnode.getEn() + " Alt : "
                        + currentnode.getAlt() + "\n");
            }
            System.out.println(result.toString());
        }
    
        class Noden {
            private String en;
            private String alt;
    
            public Noden() {
            }
    
            public void setEn(String en) {
                this.en = en;
            }
    
            public void setAlt(String alt) {
                this.alt = alt;
            }
    
            public String getEn() {
                return en;
            }
    
            public String getAlt() {
                return alt;
            }
        };
    

    retriving-

    try
            {
              SAXParserFactory factory = SAXParserFactory.newInstance();
              SAXParser saxParser = factory.newSAXParser();
              InputStream is = null;
    
              String xml = "your pasable string";
    
              String newXml = xml.substring(xml.indexOf("<translation>"), xml.indexOf("]]"));         
              System.out.println(newXml);
              is = new ByteArrayInputStream(newXml.getBytes());
              InputSource inputSource = new InputSource(is);
              saxParser.parse(inputSource,new xmlHandler());
            }
            catch(Exception ex) {
                ex.printStackTrace();
            }
    

    This will helps you.

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

Sidebar

Related Questions

I'm new to Android development and I'm currently going through some tutorials. When I
I'm new in Android development. I'm looking for any method that applies pitch shifting
I am new to Android Development and I would really appreciate some advise on
Very new to Android development, and I am importing a bitmap that is 799
I am new to Android Development and I am having trouble with my XML
I'm new to android development and I'm trying to make an android app that
As I am new to Android development, I have used SAX xml parsing in
I'm new to android development, and im trying to create an app that is
I'm new to Android development. I have an application that allows the user to
I am new to android programming and development. I am working on app that

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.