title: SAX Parser not working
body: <p>I'm trying to read an xml file using sax in java. I only get output for the endelement but I can't find out what's wrong with the startElement.</p>
  
  <p>This is my handler:</p>
  
  <pre><code>public class XMLHandler extends DefaultHandler {
  
  public void startElement(String uri, String localName,String qName, Attributes attributes) throws SAXException {
  System.out.println( "SAX Event: START ELEMENT[ " + localName + " ]" );
  }
  
  public void endElement( String namespaceURI, String localName, String qName ) throws SAXException {
  System.out.println( "SAX Event: END ELEMENT[ " + localName + " ]" );
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I test it with the following code:</p>
  
  <pre><code> public static void main(String args[]) throws ParserConfigurationException, SAXException, IOException
  {
  SAXParserFactory spf = SAXParserFactory.newInstance();
      spf.setNamespaceAware(true);
  SAXParser saxParser = spf.newSAXParser();
  saxParser.parse("http://www.w3schools.com/xml/note.xml", new XMLHandler());
  }
  </code></pre>
  
  <p>I use an example XML file from w3schools:</p>
  
  <pre><code>&lt;!-- Edited by XMLSpy® --&gt;
  &lt;note&gt;
  &lt;to&gt;Tove&lt;/to&gt;
  &lt;from&gt;Jani&lt;/from&gt;
  &lt;heading&gt;Reminder&lt;/heading&gt;
  &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
  &lt;/note&gt;
  </code></pre>
  
  <p>and this is my output:</p>
  
  <pre><code>SAX Event: END ELEMENT[ to ]
  SAX Event: END ELEMENT[ from ]
  SAX Event: END ELEMENT[ heading ]
  SAX Event: END ELEMENT[ body ]
  SAX Event: END ELEMENT[ note ]
  </code></pre>
  
  <p>I really don't get what I'm doing wrong here...</p>