<defs>
<def id="nc"><![CDATA[
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import java.io.IOException;

public class S {
  public static void main(String[] args) {
    XMLReader parser;
    try {
     parser = XMLReaderFactory.createXMLReader();
    }
    catch (SAXException e) {
     System.err.println("createXMLReader failed.");
     return;
    }
    parser.setContentHandler(new NodeCounter());
    try {
      parser.parse("stock.xml");
    }
    catch (Exception e) {
      System.err.println(e.toString());
    }
  }
}

class NodeCounter implements ContentHandler {

  // Do-nothing methods
  public void setDocumentLocator(Locator l) {}
  public void startPrefixMapping(String p, String u)
   throws SAXException {}
  public void endPrefixMapping(String p) throws SAXException {}
  public void skippedEntity(String n) throws SAXException {}
  public void processingInstruction(String t, String d)
   throws SAXException {}
  public void characters(char[] t, int s, int l)
   throws SAXException {}
  public void ignorableWhitespace(char[] t, int s, int l)
   throws SAXException{}
  public void endElement(String namespaceURI, String localName,
   String qualifiedName) throws SAXException {}

QcQ
}

]]></def>
<def id="se"><![CDATA[
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import java.io.IOException;

public class S {
  public static void main(String[] args) {
    XMLReader parser;
    try {
     parser = XMLReaderFactory.createXMLReader();
    }
    catch (SAXException e) {
     System.err.println("createXMLReader failed.");
     return;
    }
    parser.setContentHandler(new NodeCounter());
    try {
      parser.parse("stock.xml");
    }
    catch (Exception e) {
      System.err.println(e.toString());
    }
  }
}

class NodeCounter implements ContentHandler {

  // Do-nothing methods
  public void setDocumentLocator(Locator l) {}
  public void startPrefixMapping(String p, String u)
   throws SAXException {}
  public void endPrefixMapping(String p) throws SAXException {}
  public void skippedEntity(String n) throws SAXException {}
  public void processingInstruction(String t, String d)
   throws SAXException {}
  public void characters(char[] t, int s, int l)
   throws SAXException {}
  public void ignorableWhitespace(char[] t, int s, int l)
   throws SAXException{}
  public void endElement(String namespaceURI, String localName,
   String qualifiedName) throws SAXException {}
  public void startDocument() throws SAXException { }
  public void endDocument() throws SAXException { }

QcQ
}

]]></def>
<def id="all"><![CDATA[
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import java.io.IOException;

public class S {
  public static void main(String[] args) {
    XMLReader parser;
    try {
     parser = XMLReaderFactory.createXMLReader();
    }
    catch (SAXException e) {
     System.err.println("createXMLReader failed.");
     return;
    }
    parser.setContentHandler(new NodeCounter());
    try {
      parser.parse("casablanca.xml");
    }
    catch (Exception e) {
      System.err.println(e.toString());
    }
  }
}

class NodeCounter implements ContentHandler {
  // Do-nothing methods
  public void setDocumentLocator(Locator l) {}
  public void startPrefixMapping(String p, String u)
   throws SAXException {}
  public void endPrefixMapping(String p) throws SAXException {}
  public void skippedEntity(String n) throws SAXException {}
  public void processingInstruction(String t, String d)
   throws SAXException {}
  public void ignorableWhitespace(char[] t, int s, int l)
   throws SAXException{}
  public void endElement(String namespaceURI, String localName,
   String qualifiedName) throws SAXException {}
  public void startDocument() throws SAXException { }
  public void endDocument() throws SAXException { }

QcQ
}

]]></def>

</defs>
