wood burning stoves*
The moose likes XML and Related Technologies and the fly likes getting started with xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "getting started with xml" Watch "getting started with xml" New topic
Author

getting started with xml

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
hi,
just downloaded the xerces parser.now, how do i go about writing xml files. what are the initialisations and path settings ,i have to do ? please help me write my first xml
document.
thanks,
sridevi
prabhu palanisamy
Greenhorn

Joined: Oct 30, 2000
Posts: 27
hi sridevi,
here i give a small code for SAX using XERCEs parser
import org.xml.sax.XMLReader;
import org.xml.sax.*;
import java.io.*;
import org.apache.xerces.parsers.SAXParser;
public class SaxDemo
{
public void perform(String uri)
{
System.out.println("uri "+uri);
try{
XMLReader xmlr=new SAXParser();
xmlr.parse(uri);
System.out.println("no error");
}
catch(IOException e)
{
System.out.println("error "+e.getMessage());
}
catch(SAXException e)
{
System.out.println("error "+e.getMessage());
}

}
public static void main(String args[])
{
System.out.println("hello");
SaxDemo sa=new SaxDemo();
sa.perform(args[0]);
}
}
for classpath set the \tools\xerces.jar
i hope this is sufficient to start...
bye
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: getting started with xml
 
Similar Threads
books needed to clear exam
Info?
XMLUnit - The validity of a piece of XML ?
XML and Database
Configure IE to display XML?