[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to get Node value In a DOM Tree
Hi Chris, I had found where exactly the problem is .The element Node will take only null values. I have to create a DOM Tree in the following format. <Application> <application_id> 1 </application_id> <application_name>krish </application_name> < description> This is test </description> </Application> The values that I am placing in the following tags tage<application_id>,<application_name> and <description> are from database. My Code is Element root = null; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); root = document.createElement(Root_Element); document.appendChild(root); Element applicationElement =document.createElement(Application); root.appendChild(applicationElement); Element applicationIdElement =document.createElement(application_id); applicationIdElement.setNodeValue("1"); appliationElement.appendChild(applicationElement); Now let us suppose that I had created Text Node TextNode t = applicationElement.createTextNode(application_id); applicationElement.appendChild(t); Now The value which I am getting from database I am not sure that it is always be a String , Some times , it may be int,bigInt,String,Clob. In this situation How can I create DOM Tree?? To obtain the above xml structure, Whether I have to create text Node's under application?? Plz guide me. Regards, Ramu Chris Burdess <dog@b...> wrote: Seetha Rama Krishna wrote: regards,
ramu
Yahoo! India Answers: Share what you know. Learn something new http://us.rd.yahoo.com/mail/in/mailanswersshare/*http://in.answers.yahoo.com/ Send free SMS to your Friends on Mobile from your Yahoo! Messenger http://us.rd.yahoo.com/mail/in/freesms/*http://messenger.yahoo.com/download.php
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|