76
|
1 package test;
|
|
2
|
|
3 import java.io.IOException;
|
|
4 import java.io.StringReader;
|
|
5
|
|
6 import javax.xml.parsers.ParserConfigurationException;
|
|
7 import javax.xml.parsers.SAXParser;
|
|
8 import javax.xml.parsers.SAXParserFactory;
|
|
9
|
|
10 import org.xml.sax.InputSource;
|
|
11 import org.xml.sax.SAXException;
|
|
12
|
|
13 public class SessionXMLDecoder2 {
|
|
14 void parse(String string){
|
|
15 try {
|
|
16 SAXParserFactory spfactory = SAXParserFactory.newInstance();
|
|
17 SAXParser parser = spfactory.newSAXParser();
|
|
18 InputSource source = new InputSource(new StringReader(string));
|
|
19 parser.parse(source, new SessionXMLParser());
|
|
20 } catch (IOException e) {
|
|
21 // TODO Auto-generated catch block
|
|
22 e.printStackTrace();
|
|
23 } catch (ParserConfigurationException e) {
|
|
24 // TODO Auto-generated catch block
|
|
25 e.printStackTrace();
|
|
26 } catch (SAXException e) {
|
|
27 // TODO Auto-generated catch block
|
|
28 e.printStackTrace();
|
|
29 }
|
|
30 }
|
|
31 }
|