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

The Archive Base Latest Questions

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

I use DOM parser to mine the data.Problem is that i cannot manage to

  • 0

I use DOM parser to mine the data.Problem is that i cannot manage to get the “url=” “length” and “type” tag that is inside the “enclosure” tag

<item>
      <title>blah blah</title>
      <description>blah blah</description>
      <enclosure url="THEURL" length="LENGTH" type="TYPE" />
</item>

Here’s the code that i use : Can anyone point me to the right direction?

for (int t = 0; t < nList.getLength(); t++) {
                Node nNode = nList.item(t);
                if (nNode.getNodeType() == Node.ELEMENT_NODE) {

                    Element eElement = (Element) nNode;

                    System.out.println("title : "
                            + getTagValue("title", eElement));
                    System.out.println("description : "
                            + getTagValue("description", eElement));                        

                    for (int t2 = 0; t2 < nList2.getLength(); t2++) {                           
                    Node nNode2 = nList2.item(t2);                  
                    Element eElement2 = (Element) nNode2;
                    System.out.println("url: "
                            + getTagValue("url", eElement2));
                    }
                }
        }

private static String getTagValue(String sTag, Element eElement) {
    NodeList nlList = eElement.getElementsByTagName(sTag).item(0)
            .getChildNodes();
    Node nValue = (Node) nlList.item(0);

    return nValue.getNodeValue();
}
  • 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-16T17:57:37+00:00Added an answer on May 16, 2026 at 5:57 pm

    Look up the Element.getAttributes() method to retrieve all the attributes as an array. The Element.getAttributeNode(String name) will give you a specific attribute.

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

Sidebar

Related Questions

OK,I know that I should use a DOM parser, but this is to stub
How do I use jQuery to select DOM elements that do not have ID
How do I use the DOM parser to extract the content of a html
Everyone knows that we should always use DOM techniques instead of regexes to extract
me again, sorry :) I was using dom parser to get xml from web
I want to use the PHP Simple HTML DOM Parser to display all my
I'm using PHP simple dom parser http://simplehtmldom.sourceforge.net/manual.htm . I'm able to successfully use it
I am trying to use DOM Parser in Java to parse a small XML
What code would I would use to get the information a div that contains
For one of our applications, I've written a utility that uses java's DOM parser.

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.