/** End element */ @Override public void endElement(String uri, String localName, String qName) throws SAXException { str = sw.toString(); String fullUri = uri != "" ? uri + "#" + localName : localName; if (fullUri.equalsIgnoreCase(nsOws + "#ServiceIdentification")) { capabilities.setServiceIdentification(serviceIdentification); inServiceIdentification = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#OperationsMetadata")) { capabilities.setOperationsMetadata(operationsMetadata); inOperationsMetadata = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#Operation")) { if (inOperationsMetadata) { operationsMetadata.addOperation(operation); } inOperation = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#Operation")) { if (inOperationsMetadata) { operationsMetadata.addOperation(operation); } inOperation = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#Parameter")) { if (inOperation) { operation.addParameter(parameter); } inParameter = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#Value")) { if (inParameter) { parameter.addAllowedValue(new String(str)); } } else if (fullUri.equalsIgnoreCase(nsSos + "#ObservationOffering")) { // we loaded the offering object from the Capabilities document offering.loaded(); // add offering to capabilities document // NOTE: right now we require offerings to have LAT LONG if (!noLatLong) capabilities.addSensorOffering(offering); inOffering = false; } else if (fullUri.equalsIgnoreCase(nsGml + "#description")) { offering.setDescription(str); } else if (fullUri.equalsIgnoreCase(nsGml + "#name")) { if (inOffering) offering.setName(str); } else if (fullUri.equalsIgnoreCase(nsGml + "#srsName")) { if (inOffering) offering.setSrsName(str); } else if (fullUri.equalsIgnoreCase(nsSos + "#responseFormat")) { if (inOffering) offering.addResponseFormat(str); } else if (fullUri.equalsIgnoreCase(nsSos + "#resultModel")) { if (inOffering) offering.setResultModel(str); } else if (fullUri.equalsIgnoreCase(nsSos + "#responseMode")) { if (inOffering) offering.setResponseMode(str); } else if (fullUri.equalsIgnoreCase(nsGml + "#lowerCorner")) { if (inOffering) { double latlong[] = getLatLong(str.trim()); if (latlong != null) { offering.setLowerCornerLat(latlong[0]); offering.setLowerCornerLong(latlong[1]); } else { noLatLong = true; } } } else if (fullUri.equalsIgnoreCase(nsGml + "#upperCorner")) { if (inOffering) { double latlong[] = getLatLong(str.trim()); if (latlong != null) { offering.setUpperCornerLat(latlong[0]); offering.setUpperCornerLong(latlong[1]); } else { noLatLong = true; } } } else if (fullUri.equalsIgnoreCase(nsOws + "#Title")) { if (inServiceIdentification) { serviceIdentification.setTitle(Util.cleanUpString(str)); } } else if (fullUri.equalsIgnoreCase(nsOws + "#Abstract")) { if (inServiceIdentification) { serviceIdentification.setAbstract(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#Keyword")) { if (inServiceIdentification) { serviceIdentification.addKeywords(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#ServiceType")) { if (inServiceIdentification) { serviceIdentification.setServiceType(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#ServiceTypeVersion")) { if (inServiceIdentification) { serviceIdentification.addServiceTypeVersion(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#AccessConstraints")) { if (inServiceIdentification) { serviceIdentification.addAccessConstraint(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#Fees")) { if (inServiceIdentification) { serviceIdentification.setFees(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#ServiceProvider")) { serviceProvider.setContact(serviceContact); capabilities.setServiceProvider(serviceProvider); inServiceProvider = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#ProviderName")) { if (inServiceProvider) { serviceProvider.setName(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#ServiceContact")) { if (inServiceContact) { String name = ""; if (individualName != null) name = individualName; serviceContact = new ServiceContact(name, contactInfo); } inServiceContact = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#IndividualName")) { if (inServiceContact) individualName = new String(str); } else if (fullUri.equalsIgnoreCase(nsOws + "#ContactInfo")) { if (phone != null) contactInfo.setPhone(phone); contactInfo.setAddress(address); inContactInfo = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#Voice")) { if (inContactInfo) phone = new String(str); } else if (fullUri.equalsIgnoreCase(nsOws + "#Address")) { inAddress = false; } else if (fullUri.equalsIgnoreCase(nsOws + "#DeliveryPoint")) { if (inAddress) { address.setDeliveryPoint(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#City")) { if (inAddress) { address.setCity(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#AdministrativeArea")) { if (inAddress) { address.setAdministrativeArea(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#PostalCode")) { if (inAddress) { address.setPostalCode(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#Country")) { if (inAddress) { address.setCountry(str); } } else if (fullUri.equalsIgnoreCase(nsOws + "#ElectronicMailAddress")) { if (inAddress) { address.setEmaill(str); } } else if (fullUri.equalsIgnoreCase(nsSos + "#time")) { inTime = false; } else if (fullUri.equalsIgnoreCase(nsGml + "#beginPosition")) { if (inTime) { Date begin = TimeUtils.parseDefault(str); offering.setStartTime(begin); } } else if (fullUri.equalsIgnoreCase(nsGml + "#endPosition")) { if (inTime) { /* * Only parse the end time if it is given */ if (endTimeIndeterminate) { endTimeIndeterminate = false; } else { Date end = TimeUtils.parseDefault(str); offering.setEndTime(end); } } } else if (fullUri.equalsIgnoreCase(nsGml + "#timeInterval")) { if (inTime) { // TODO: find out which units are valid double interval = 60.0 * Double.parseDouble(str); offering.setInterval(interval); } } }