[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

dom and jsp interacation

  • From: Seetha Rama Krishna <ram_kurra@xxxxxxxxxxx>
  • To: xml-dev@xxxxxxxxxxxxx
  • Date: Thu, 31 Aug 2006 11:44:45 +0100 (BST)

jsp documentbuilderfactory
Hello Techies,
          I am having one jsp thru which I am getting  tag's of the xml file. I want to get the values of these tags when perticular tag is required.
       Here is sample xml file
<Date>
<Today>
   <Today_Id>12345</Today_Id>
   <Today_Name>TODAY</Today_Name>
   <Today_Data_Type>date</Today_Data_Type>
</Today>
<EndOfWeek>
   <EndOfWeek_Id>6789</EndOfWeek_Id>
   <EndOfWeek_Name>ENDOFWEEK</EndOfWeek_Name>
   <EndOfWeek_Data_Type>date</EndOfWeek_Data_Type>
</EndOfWeek>
</Date>

    lets us suppose that from jsp I got "Today" as request. Now I created the instance and parsing the xml file.
  
DocumentBuilderFactory factory = DocumentBuilderFactory
                    .newInstance();
            DocumentBuilder parser = factory.newDocumentBuilder();
            Document document = parser.parse(xmlFileName);
            Element documentElement = document.getDocumentElement();
            NodeList nl = documentElement
                    .getElementsByTagName("Today");
            ArrayList mapp = iteratingEachNodeChildValueList(nl);

       For the next request is EndOfWeek. Here the question arises
"does i need to create the instance of parser and  read the file for each request??"


         


regards,
ramu


Here's a new way to find what you're looking for - http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. http://us.rd.yahoo.com/mail/in/messengertagline/*http://in.messenger.yahoo.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.