Ignore:
Timestamp:
2011-07-04T10:49:50+12:00 (13 years ago)
Author:
sjm84
Message:

Added more functionality to ArchiveRetrieve, added an additonal parameter to printXMLNode in GSXML that controls whether text nodes are to be printed or not and also made the infodb type of collections more easily accessible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java

    r24214 r24221  
    8585  public static final String DOC_TYPE_ELEM = "docType";
    8686  public static final String SEARCH_ELEM = "search";
     87  public static final String INFODB_ELEM = "infodb";
    8788  public static final String INDEX_ELEM = "index";
    8889  public static final String INDEX_STEM_ELEM = "indexStem";
     
    125126  public static final String LANG_ATT = "lang";
    126127  public static final String TYPE_ATT = "type";
     128  public static final String DB_TYPE_ATT = "dbType";
    127129  public static final String VALUE_ATT = "value";
    128130  public static final String DEFAULT_ATT = "default";
     
    920922  }
    921923 
    922   public static void printXMLNode(Node e) {
    923     printXMLNode(e, 0) ;
     924  public static void printXMLNode(Node e, boolean printText) {
     925    printXMLNode(e, 0, printText) ;
    924926  }
    925927 
     
    977979  }
    978980 
    979   public static void printXMLNode(Node e, int depth) { //recursive method call using DOM API...
    980    
     981  public static void printXMLNode(Node e, int depth, boolean printText) { //recursive method call using DOM API...
     982   
     983    if(e == null){return;}
     984   
    981985    for (int i=0 ; i<depth ; i++)
    982986      System.out.print(' ') ;
    983987   
    984988    if (e.getNodeType() == Node.TEXT_NODE){
    985       // shouldn't we actually print the text here????
    986       System.out.println("text") ;
     989      if(printText){
     990        System.out.println(e.getNodeValue());
     991      }
     992      else {
     993        System.out.println("text");
     994      }
    987995      return ;
    988996    }
     
    10141022      int len = children.getLength();
    10151023      for (int i = 0; i < len; i++) {
    1016         printXMLNode(children.item(i), depth + 1);
     1024        printXMLNode(children.item(i), depth + 1, printText);
    10171025      }
    10181026     
Note: See TracChangeset for help on using the changeset viewer.