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

  • Home
  • SEARCH
  • 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 8193981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:39:56+00:00 2026-06-07T04:39:56+00:00

I have one local xml file. I am storing here : res/xml/myxml.xml <?xml version=1.0

  • 0

I have one local xml file. I am storing here : res/xml/myxml.xml

<?xml version="1.0" encoding="utf-8"?>
<list>
<lists>
    <tag>College Website</tag>
    <value>http://www.nitk.ac.in/</value>
    <lastupdate>04-07-2012</lastupdate>
</lists>
<lists>
    <tag>College Images</tag>
    <value>http://studentsworld.nitk.ac.in/index.php?q=convocation.html</value>
    <lastupdate>25-9-2011</lastupdate>
</lists>
</list>

I have doc for loop. but how to connect local xml file in doc parser. i don’t want url model, i want to a local xml file.

for (int i = 0; i < nodeList.getLength(); i++) {

            Node node = nodeList.item(i);

            tag[i] = new TextView(this);
            value[i] = new TextView(this);
            lastupdate[i] = new TextView(this);

            Element fstElmnt = (Element) node;
            NodeList nameList = fstElmnt.getElementsByTagName("tag");
            Element nameElement = (Element) nameList.item(0);
            nameList = nameElement.getChildNodes();
            tag[i].setText("tag = " + ((Node) nameList.item(0)).getNodeValue());

            NodeList websiteList = fstElmnt.getElementsByTagName("value");
            Element websiteElement = (Element) websiteList.item(0);
            websiteList = websiteElement.getChildNodes();
            value[i].setText("value = " + ((Node) websiteList.item(0)).getNodeValue());

            NodeList lastupdateList = fstElmnt.getElementsByTagName("tag");
            Element lastupdateElement = (Element) lastupdateList.item(0);
            lastupdateList = lastupdateElement.getChildNodes();
            lastupdate[i].setText("lastupdate = " + ((Node) lastupdateList.item(0)).getNodeValue());



            layout.addView(tag[i]);
            layout.addView(value[i]);
            layout.addView(lastupdate[i]);

        }
    } catch (Exception e) {
        System.out.println("XML Pasing Excpetion = " + e);
    }

I have main.xml file
please send me a code

  • 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-07T04:39:58+00:00Added an answer on June 7, 2026 at 4:39 am

    put you XML file in assets folder and try this

    InputStream raw = getApplicationContext().getAssets().open("simple.xml");

    and try this

    DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder dBuilder= dbFactory.newDocumentBuilder();
    Document doc = dBuilder.parse(raw);
    ....
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have trouble loading an xml file stored on my local network... (you could
I have zip file in ftp server,this zip file contain more then one xml
I have one repo hosted at https://github.com/aikiframework/json . On my local copy, I added
i have a string like this one: $string = some text http://dvz.local/index/index/regionId/28 http://stuff.kiev.ua/roadmap_page.php http://192.168.3.192/roadmap_page.php
I have a asp.net website in my local IIS and one of a page
I have one XML request which I need to modify (to XML) and then
I have one drop down list in my page, which contains two options. What
I have one problem with parsing *.docx document with OpenXML (C#). So, here's my
I have pom.xml that contains defined values. I would like to use one of
I have one doubt regarding xml reading using Stax Parser. Expected Result: hq_seq_mast {SEQ_VAL=SEQ_VAL,

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.