Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: DOM XML parser question

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default [SOLVED] DOM XML parser question

    Hi I'm using the DOM XML parser classes and wandered if this is a correct perception:

    Element eElement = (Element) node;
     NodeList feedlist = eElement.getElementsByTagName("url");
     Element feedname = (Element) feedlist.item(0);
      NodeList feed2 = feedname.getChildNodes();
    //set the element as country, get all tags specified as url
    //set element as first in list and get its childnodes (values)

    Just for reference the nodelist (node) not specified here is looking for elementsbytagname("country") which where the country comment comes from.
    Last edited by LDM91; December 30th, 2010 at 07:30 AM.


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 286 Times in 225 Posts
    Blog Entries
    4

    Default Re: DOM XML parser question

    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

  3. The Following User Says Thank You to JavaPF For This Useful Post:

    LDM91 (December 30th, 2010)

  4. #3
    Junior Member
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: DOM XML parser question

    Thanks for the link, yes it does. I've used DOM parsing in PHP before but was a bit confused because in Java it seemed throw in another step which I didn't quite understand. Turns out I misinterpreted it slightly but I understand it now =]

  5. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 286 Times in 225 Posts
    Blog Entries
    4

    Default Re: DOM XML parser question

    Good. Glad I could help
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

Similar Threads

  1. Java Parser
    By sid0009 in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: August 20th, 2010, 11:06 AM
  2. SAX Parser will not add object to arrayList
    By michaelz in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 1st, 2010, 02:59 PM
  3. XML DOM Parser problem
    By kanishktew in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 10th, 2010, 09:42 PM
  4. where can i get a Dom Parser jar ?
    By chinni in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: November 26th, 2009, 02:41 AM
  5. Infix to Prefix parser
    By r2ro_serolf in forum Java Theory & Questions
    Replies: 1
    Last Post: November 8th, 2009, 12:11 AM