/** Replies the resource URL that is contained inside the XML attribute * defined in the given node and with the given XML path. * * @param node is the XML node to read. * @param resources is the collection of resources to read. * @param path is the XML path, relative to the node, of the attribute. The last * element of the array is the name of the attribute. * @return the resource URL, or <code>null</code> if it cannot be retrieved. */ @Pure public static URL readResourceURL(Element node, XMLResources resources, String... path) { final String stringValue = getAttributeValue(node, path); if (XMLResources.isStringIdentifier(stringValue)) { try { final long id = XMLResources.getNumericalIdentifier(stringValue); return resources.getResourceURL(id); } catch (Throwable exception) { // } } return null; }
String sattr = XMLUtil.getAttributeValueWithDefault(xmlNode, null, MapElementLayer.ATTR_ELEMENT_ATTRIBUTES_URL); if (sattr != null && sattr.length() > 0) { if (XMLResources.isStringIdentifier(sattr)) { final long id = XMLResources.getNumericalIdentifier(sattr); final Entry resource = resources.getResource(id); sattr = XMLUtil.getAttributeValueWithDefault(xmlNode, null, MapElementLayer.ATTR_ELEMENT_GEOMETRY_URL); if (sattr != null && sattr.length() > 0) { if (XMLResources.isStringIdentifier(sattr)) { final long id = XMLResources.getNumericalIdentifier(sattr); final Entry resource = resources.getResource(id);