Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] getting elements from xml file using DOM

From: Tatu Saloranta <cowtowncoder@-----.--->
To: xml dev <xml-dev@-----.---.--->
Date: 9/1/2006 5:34:00 PM
--- Seetha Rama Krishna <ram_kurra@y...> wrote:

> can any body tell me how can i get first level of
> elements in the xml file

How about you google for something like "DOM
tutorial"? (and if necessary, spice up with your
favourite language and/or platform for more specific
instructions).

Kids these days,

-+ Tatu +-

> 
> Robert Koberg <rob@k...> 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
> 
> 
> 
> 
> 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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent