View Javadoc

1   /*
2      $Id: ConfigElementLoader.java,v 1.1.1.1 2003/08/25 18:36:28 mch Exp $
3   
4      Date         Author      Changes
5      17 Oct 2002  M Hill      Created
6   
7      (c) Copyright...
8   */
9   
10  package org.astrogrid.test;
11  
12  import org.w3c.dom.Document;
13  import org.w3c.dom.Element;
14  
15  import javax.xml.parsers.*;
16  import org.astrogrid.xmlutils.*;
17  
18  import org.astrogrid.tools.xml.EasyDomLoader;
19  import java.io.IOException;
20  
21  import org.astrogrid.log.Log;
22  
23  /***
24   *  Configuration node loader - reads from an XML file, and returns the
25   * node corresponding to the Config parameters.  Used as part of test harnesses
26   * - normally Axis will pass this node already-loaded to the wrapper
27  
28   *  @author           : M Hill
29   */
30  public class ConfigElementLoader
31  {
32  
33     /***
34      * Loads and returns the 'configParams' DOM node (Element) from the given
35      * XML file
36      */
37     public static Element loadElement(String filename) throws IOException
38     {
39        Element rootNode = EasyDomLoader.loadElement(filename);
40  
41        //quick fix for extra node depth
42        //Element configNode = (Element) rootNode.getElementsByTagName("SExtractorData").item(0);
43        Element configNode = rootNode;
44        
45        return configNode;
46     }
47  
48  }
49