[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] getting elements from xml file using DOM
- From: Seetha Rama Krishna <ram_kurra@yahoo.co.in>
- To: Robert Koberg <rob@koberg.com>
- Date: Fri, 1 Sep 2006 11:24:55 +0100 (BST)
can any body tell me how can i get first level of elements in the xml file
Robert Koberg <rob@koberg.com> wrote:
School project?
Seetha Rama Krishna wrote:
> Hi Techies,
> I am reading an xml file using DOM. Here is my xml file
>
>
>
> 12345
> TODAY
> date
>
>
> 12345
> TODAY
> date
>
>
>
>
>
>
>
> Here i want to get only and not the child nodes of
> ,, when i read the xml file . How can I do this one.
>
> I tried with the
following code.
> DocumentBuilderFactory factory = DocumentBuilderFactory
> .newInstance();
> DocumentBuilder parser = factory.newDocumentBuilder();
> Document document = parser.parse(xmlFileName);
> Element documentElement = document.getDocumentElement();
> NodeList todayNodeList = documentElement
> .getElementsByTagName("Today");
>
> How can get only first level of nodes. That is I want get
> only Today,EndOfWeek,EndOfMonth.
>
>
>
>
> regards,
> Krishna
>
>
> regards,
> ramu
Here's a new way to find what you're looking for - Yahoo! Answers
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]