- Timestamp:
- 2011-07-04T10:49:50+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r24214 r24221 85 85 public static final String DOC_TYPE_ELEM = "docType"; 86 86 public static final String SEARCH_ELEM = "search"; 87 public static final String INFODB_ELEM = "infodb"; 87 88 public static final String INDEX_ELEM = "index"; 88 89 public static final String INDEX_STEM_ELEM = "indexStem"; … … 125 126 public static final String LANG_ATT = "lang"; 126 127 public static final String TYPE_ATT = "type"; 128 public static final String DB_TYPE_ATT = "dbType"; 127 129 public static final String VALUE_ATT = "value"; 128 130 public static final String DEFAULT_ATT = "default"; … … 920 922 } 921 923 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) ; 924 926 } 925 927 … … 977 979 } 978 980 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 981 985 for (int i=0 ; i<depth ; i++) 982 986 System.out.print(' ') ; 983 987 984 988 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 } 987 995 return ; 988 996 } … … 1014 1022 int len = children.getLength(); 1015 1023 for (int i = 0; i < len; i++) { 1016 printXMLNode(children.item(i), depth + 1 );1024 printXMLNode(children.item(i), depth + 1, printText); 1017 1025 } 1018 1026
Note:
See TracChangeset
for help on using the changeset viewer.