/** Start element */
  @Override
  public void startElement(String uri, String localName, String qName, Attributes attributes)
      throws SAXException {

    sw = new StringWriter();

    String fullUri = uri != "" ? uri + "#" + localName : localName;

    if (fullUri.equalsIgnoreCase(nsSos + "#Capabilities")) {
      capabilities = new SosCapabilities();
    } else if (fullUri.equalsIgnoreCase(nsOws + "#ServiceIdentification")) {
      serviceIdentification = new ServiceIdentification();
      inServiceIdentification = true;
    } else if (fullUri.equalsIgnoreCase(nsOws + "#ServiceProvider")) {
      serviceProvider = new ServiceProvider();
      inServiceProvider = true;
    } else if (fullUri.equalsIgnoreCase(nsOws + "#ServiceContact")) {
      inServiceContact = true;
    } else if (fullUri.equalsIgnoreCase(nsOws + "#ContactInfo")) {
      contactInfo = new ContactInfo();
      inContactInfo = true;
    } else if (fullUri.equalsIgnoreCase(nsOws + "#OperationsMetadata")) {
      operationsMetadata = new OperationsMetadata();
      inOperationsMetadata = true;
    } else if (fullUri.equalsIgnoreCase(nsOws + "#Operation")) {
      String name = attributes.getValue("name");
      operation = new Operation(name);
      inOperation = true;
    } else if (fullUri.equalsIgnoreCase(nsOws + "#Get")) {
      if (inOperation) {
        String address = attributes.getValue(nsXlink, "href");
        operation.addServiceAddress("get", address);
      }
    } else if (fullUri.equalsIgnoreCase(nsOws + "#Post")) {
      if (inOperation) {
        String address = attributes.getValue(nsXlink, "href");
        operation.addServiceAddress("post", address);
      }
    } else if (fullUri.equalsIgnoreCase(nsOws + "#Parameter")) {
      String name = attributes.getValue("name");
      parameter = new Parameter(name);
      inParameter = true;
    } else if (fullUri.equalsIgnoreCase(nsSos + "#ObservationOffering")) {
      String gmlId = attributes.getValue(nsGml, "id");
      offering = new SensorOffering(gmlId);
      inOffering = true;
      noLatLong = false;
    } else if (fullUri.equalsIgnoreCase(nsOws + "#ProviderSite")) {
      if (inServiceProvider) {
        String site = attributes.getValue(nsXlink, "href");
        serviceProvider.setSite(site);
      }
    } else if (fullUri.equalsIgnoreCase(nsOws + "#Address")) {
      if (inContactInfo) {
        address = new Address();
        inAddress = true;
      }
    } else if (fullUri.equalsIgnoreCase(nsSos + "#procedure")) {
      String procedure = attributes.getValue(nsXlink, "href");
      offering.addProcedure(procedure);
    } else if (fullUri.equalsIgnoreCase(nsSos + "#observedProperty")) {
      String property = attributes.getValue(nsXlink, "href");
      offering.addObservedProperty(property);
    } else if (fullUri.equalsIgnoreCase(nsSos + "#featureOfInterest")) {
      String feature = attributes.getValue(nsXlink, "href");
      offering.addFeatureOfInterest(feature);
    } else if (fullUri.equalsIgnoreCase(nsSos + "#time")) {
      if (inOffering) inTime = true;
    } else if (fullUri.equalsIgnoreCase(nsGml + "#endPosition")) {
      if (inTime) {
        String value = attributes.getValue("indeterminatePosition");
        if (value != null) endTimeIndeterminate = true;
      }
    } else if (fullUri.equalsIgnoreCase(nsGml + "#timeInterval")) {
      if (inTime) {
        timeUnits = attributes.getValue("unit");
      }
    }
  }