예제 #1
0
 @Override
 public void startElement(String uri, String localName, String qName, Attributes attributes)
     throws SAXException {
   System.out.print("<" + qName);
   for (int i = 0; i < attributes.getLength(); i++)
     System.out.format(" %s='%s'", attributes.getQName(i), attributes.getValue(i));
   System.out.print(">");
   super.startElement(uri, localName, qName, attributes);
 }
예제 #2
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   System.out.print("</" + qName + ">");
   super.endElement(uri, localName, qName);
 }
예제 #3
0
 @Override
 public void characters(char[] ch, int start, int length) throws SAXException {
   System.out.print(new String(ch, start, length));
   super.characters(ch, start, length);
 }