title: Parameters in SAXParser 'startElement' method always null
body: <p>I am trying to implement a sax parser to load some XML. However all the paramaters in the methods inside the DefaultHandler are always null. For example calling <code>System.out.println(uri);</code> inside the <code>startElement</code> method prints null. Code is below. No exceptions/errors are being printed anywhere when code is run. Any ideas/help are appreciated.</p>
  
  <p><strong>Default Handler:</strong></p>
  
  <pre><code>    try {
  
          handler = new DefaultHandler(){
              int channel_amt = 0;
  
              public void startElement(String uri, String localname, String name, Attributes attributes) throws SAXException {
  
                  if(name == "fixture"){
                      profileID++;
                      System.out.println(attributes.getValue(0));
                      profile_name = attributes.getValue(0);
                      profile_mode = attributes.getValue(1);
                      profile_channels.clear();
                  } else {
  
                      if(name == "channel"){
  
                          profile_channel = new Vector&lt;Object&gt;();
                          profile_channel.addElement(attributes.getValue(0));
                          profile_channel.addElement(attributes.getValue(1));
              //          profile_channel.addElement(Boolean.parseBoolean(attributes.getValue(2)));
  
                          channel_amt++;
                          if(Arrays.asList(channels).indexOf(attributes.getValue(1)) != -1){
                              profile_channel_function[Arrays.asList(channels).indexOf(attributes.getValue(1))] = channel_amt;
                          }
  
                      } else {
                          profile_channel.addElement(new Range(Integer.parseInt(attributes.getValue(0)), Integer.parseInt(attributes.getValue(1)), attributes.getValue(2)));
                      }
  
                  } 
  
              }       
              public void endElement(String uri, String localname, String name) throws SAXException {
  
                  if(name == "fixture"){
                      profile[profileID] = new Profile(profile_name, profile_mode, profile_channels, profile_built_in_dimmer, profile_channel_function);
                  } else if(name == "channel"){
                      profile_channels.add(profile_channel);
                  }
  
              }
          };
  
          loadProfile("Dimmer.xml");
  
      } catch(Exception e){
          e.printStackTrace();
      }
  </code></pre>
  
  <p><strong>loadProfile Method:</strong></p>
  
  <pre><code>    public void loadProfile(String name){
          for(int c=0;c&lt;51;c++){
              profile_channel_function[c] = 0;
          }
  
          SAXParser parser;
          try {
              parser = factory.newSAXParser();
              parser.parse(new File(name), handler);
          } catch (Exception e) {
              e.printStackTrace();
          }
  
      }
  </code></pre>
  
  <p>Thankyou in advance.</p>