• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

getting started with xml

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic