Ignore:
Timestamp:
09/06/11 13:04:37 (13 years ago)
Author:
gaba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SRUAction.java

    r1512 r1521  
    2929
    3030import eu.clarin.cmdi.mdservice.internal.Cache;
     31import eu.clarin.cmdi.mdservice.internal.Helpers;
    3132
    3233
     
    402403        }
    403404
    404          public static Document newDocumentFromInputStream(InputStream in) {
    405                     DocumentBuilderFactory factory = null;
    406                     DocumentBuilder builder = null;
    407                     Document ret = null;
    408 
    409                     try {
    410                       factory = DocumentBuilderFactory.newInstance();
    411                       builder = factory.newDocumentBuilder();
    412                     } catch (ParserConfigurationException e) {
    413                       e.printStackTrace();
    414                     }
    415 
    416                     try {
    417                       ret = builder.parse(new InputSource(in));
    418                     } catch (SAXException e) {
    419                       e.printStackTrace();
    420                     } catch (IOException e) {
    421                       e.printStackTrace();
    422                     }
    423                     return ret;
    424                   }
    425 
     405       
    426406
    427407        public void postprocess() throws TransformerConfigurationException, UnsupportedEncodingException, ParserConfigurationException, TransformerException, TransformerFactoryConfigurationError{
     
    443423                // add diagnostics
    444424                if (getDiagnostics().Exists()){
    445                         Document doc = newDocumentFromInputStream(this.getResultStream());
     425                        Document doc = Helpers.getDocument(this.getResultStream());
    446426                        Node r_element=  doc.getElementsByTagName("searchRetrieveResponse").item(0);
    447427                        Document ddoc = getDiagnostics().buildXMLDocument();
Note: See TracChangeset for help on using the changeset viewer.