Changeset 29522 for main/trunk
- Timestamp:
- 2014-12-03T12:40:42+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r29306 r29522 1041 1041 { 1042 1042 Node child = children.item(i); 1043 if (child.getNodeType() == Node.ELEMENT_NODE && child.getNamespaceURI() .equals(namespace_uri) && child.getLocalName().equals(node_local_name))1043 if (child.getNodeType() == Node.ELEMENT_NODE && child.getNamespaceURI() != null && child.getNamespaceURI().equals(namespace_uri) && child.getLocalName().equals(node_local_name)) 1044 1044 { 1045 1045 if (((Element) child).getAttribute(attribute_name).equals(attribute_value)) … … 1058 1058 { 1059 1059 Node child = children.item(i); 1060 if (child.getNodeType() == Node.ELEMENT_NODE && child.getNamespaceURI() .equals(namespace_uri) && child.getLocalName().equals(node_local_name))1060 if (child.getNodeType() == Node.ELEMENT_NODE && child.getNamespaceURI() != null && child.getNamespaceURI().equals(namespace_uri) && child.getLocalName().equals(node_local_name)) 1061 1061 { 1062 1062 if (((Element) child).getAttribute(attribute_name).equals(attribute_value)) … … 1141 1141 { 1142 1142 Node child = children.item(i); 1143 if (child.getNodeType() == Node.ELEMENT_NODE && child.getNamespaceURI() .equals(namespace) && child.getLocalName() != null && child.getLocalName().equals(node_local_name))1143 if (child.getNodeType() == Node.ELEMENT_NODE && child.getNamespaceURI() != null && child.getNamespaceURI().equals(namespace) && child.getLocalName() != null && child.getLocalName().equals(node_local_name)) 1144 1144 { 1145 1145 if (((Element) child).getAttribute(attribute_name).equals(attribute_value)) … … 1220 1220 } 1221 1221 1222 public static String getMetadataValue(Element metadata_list, String name) { 1223 Element meta = getNamedElement(metadata_list, METADATA_ELEM, NAME_ATT, name); 1224 if (meta == null) { 1225 return ""; 1226 } 1227 String att_value = meta.getAttribute(VALUE_ATT); 1228 if (att_value.equals("")) { 1229 // try the text 1230 att_value = getNodeText(meta); 1231 } 1232 return att_value; 1233 } 1222 1234 /** 1223 1235 * Returns the appropriate language element from a display elem, display is
Note:
See TracChangeset
for help on using the changeset viewer.