andy yeo

Greenhorn
+ Follow
since Jul 26, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by andy yeo

I tried with the below to parse in a existing xml document in a jsp page.
String getFileName;// dir of xml file
getFileName = request.getParameter("selected");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document node = builder.parse(new File(getFileName));
When I try to load the page, the following error was displayed.
Class jsp_servlet._fypj._supplier._receivepip.Document not found.
It seems that the xml document is not found. Can someone tell me wat was the error here. thx.
I am a little confused here. All the examples codes I have found on the web using dom and jaxp is about converting with a existing xml document. Is there any way to create a new xml document?
Sorry I got a real simple question.
I wanted to create a new xml document and then input elements to the document using dom.
My codes goes something like this:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try{
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.newDocument();

Element root=document.createElement("Pip3");
Element fromRole = document.createElement("fromRole");
..................
Is my codes going the right direction? If so how to name the xml file?Please advice. Thanks in advance.