Then I want to create a xsl which display only subject as hyperlink . when clicked this take the value of that message id and display message. I am new to xml and I want to know whether I should use xsl or use parser and dom with jsp. When a new record is entered then it should take the last value of messageID from xml file and and increment it for new one. It is a type of guestbook. I have downloaded xerces and running its examples. But I want to know what I follow to complete this small task. thanks in advance payal sharma
Joined: Oct 04, 2000
One more thing I want to tell I am using jsp and servlet for inserting username,subject,message. payal sharma
dear sharma, Here i've furnished the sample code to achieve your task.I've done by using wml,jsp and xtags. In these examples the msg.jsp file would parse the xml file and get the record id of the corresponding subject link..msg1.jsp gets the record id from msg.jsp and display the message.. msg.xml ------- <?xml version="1.0"?> <record> <row> <user>ajith</user> <recordid>1</recordid> <subject>Hello</subject> <message>Welcome to java ranch</message> </row> <row> <user>Maprapatu</user> <recordid>2</recordid> <subject>xml</subject> <message>Welcome to xml discussion</message> </row> </record> msg.jsp ------- <%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %> <%@ page language="java" contentType="text/vnd.wap.wml" %> <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
Thanks Parama guru, Your code help me lot to use xtags library in my example. In future for learning java and xml what I should learn. These are lot of packages in market as xerces,xalan,dom,jaxp from apache now sun in jdk1.4 beta had included sax and dom library.Where these are best used? Any idea Payal sharma
Joined: Aug 17, 2001
Hi, I heard from sources that in future if the web related technogies boom up then XML will play a main role to accomplish all our tasks.As you know It acts as a layer between our application and the database.To do like this we can avoid network traffic and deal faster.
There are many parsers like xerces,jaxp etc.,available in the market.If we install those plug ins then we can do all necessary operations in our XML document according to our requirement. It all depends on you to use such parsers.
Java programmers may use parsers like jaxp,dom4j etc., Taglib programmers may use xtags.
These 3rd party plug in providers are focussing the type of programmers and giving their set of own APIs/packages or taglibs. So programmers who are specialized in their areas can make use of those respective plug ins.