Changeset 7530
- Timestamp:
- 2004-06-02T12:00:03+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/shell/GShellElement.java
r6388 r7530 29 29 import java.util.StringTokenizer; 30 30 import org.greenstone.gatherer.util.StaticStrings; 31 31 32 /** This class wraps around a pseudo-XML message we have recieved from an external script, and allows access to the element name, attributes etc via method calls. */ 32 33 public class GShellElement { … … 35 36 private String element_name; 36 37 /** Create a new element around the message string. The string is expected to start with < and end with > */ 38 /** this is a hack - why aren't we using proper XML parsing?? */ 37 39 public GShellElement(String message) { 38 40 // Remove the angle brackets … … 62 64 attribute_value = attribute_value.substring(0, attribute_value.length() - 1); 63 65 } 64 // We may have to strip ' marks off value 65 if(attribute_value.startsWith(StaticStrings.SINGLE_QUOTE_CHARACTER) && attribute_value.endsWith(StaticStrings.SINGLE_QUOTE_CHARACTER)) { 66 attribute_value = attribute_value.substring(1, attribute_value.length() - 1); 66 // We may have to strip ' marks off value - if it starts with ' and doesn't end with ' we read in more tokens until we get an ending ' 67 if(attribute_value.startsWith(StaticStrings.SINGLE_QUOTE_CHARACTER)) { 68 while (!attribute_value.endsWith(StaticStrings.SINGLE_QUOTE_CHARACTER) && tokenizer.hasMoreTokens()) { 69 attribute_value += " "+tokenizer.nextToken(); 70 } 71 if (attribute_value.endsWith(StaticStrings.SINGLE_QUOTE_CHARACTER)) { 72 attribute_value = attribute_value.substring(1, attribute_value.length() - 1); 73 } 67 74 } 68 75 if(attributes == null) {
Note:
See TracChangeset
for help on using the changeset viewer.