private SortedSet<String> requestRepresentativeDomains(String url) {
		try {

			//System.out.println(url);

			final SortedSet<String> results = new TreeSet<String>();
			DefaultHandler handler = new DefaultHandler() {
				@Override
				public void startElement(String uri, String localName,String qName,
						Attributes attributes) throws SAXException {

					//System.out.println("Start Element :" + qName);

					if (qName.equalsIgnoreCase("representative")) {
						String name = attributes.getValue("name");
						results.add(name);
					}
				}
			};
			handleRestRequest(url,handler);
			return results;
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (SAXException e) {
			e.printStackTrace();
		} catch (ParserConfigurationException e) {
			e.printStackTrace();
		}
		return null;
	}
private SortedSet < String > requestRepresentativeDomains ( String url ) { try { final SortedSet < String > results = new TreeSet < String > ( ) ; DefaultHandler handler = new DefaultHandler ( ) { @ Override public void startElement ( String uri , String localName , String qName , Attributes attributes ) throws SAXException { if ( qName . equalsIgnoreCase ( "representative" ) ) { String name = attributes . getValue ( "name" ) ; results . add ( name ) ; } } } ; handleRestRequest ( url , handler ) ; return results ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( SAXException e ) { e . printStackTrace ( ) ; } catch ( ParserConfigurationException e ) { e . printStackTrace ( ) ; } return null ; }
Handles fetching and parsing XML from representativeDomains requests
@param url Eg "http://www.rcsb.org/pdb/rest/representativeDomains"
@return The names of all domain representatives