?? sax_parser.java
字號:
import javax.xml.parsers.*;
import java.io.*;
public class SAX_Parser
{
public SAX_Parser()
{
}
public static void main(String[] args)
{
int ch = 6;
String str = " ";
BufferedReader in;
SAXParser sax;
try
{
in = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter search criterion: \n1- NAME \n2- STREET \n3- CITY \n4- PIN");
ch = Integer.parseInt(in.readLine());
System.out.println("Enter property to search");
str = in.readLine();
System.out.println("Your choice is " + ch + " and property is "+str);
}
catch(Exception e)
{
System.out.println(e);
}
try
{
Handler handle = new Handler(ch,str);
SAXParserFactory fact = SAXParserFactory.newInstance();
sax = fact.newSAXParser();
sax.parse( new File("addres.xml"), handle );
}
catch(Exception e)
{
System.out.println(e);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -