static void split(String uriStr, String namespace, String localname) { if (namespace == null && localname != null) fail("Bad test - namespace is null but local name is not"); if (namespace != null && localname == null) fail("Bad test - namespace is not null but local name is"); int idx = Util.splitNamespaceXML(uriStr); if (idx == uriStr.length()) { // No split. if (namespace != null) fail("Expected a split (" + namespace + "," + localname + ") - but none found"); return; } // Split String ns = uriStr.substring(0, idx); String ln = uriStr.substring(idx); assertEquals(namespace, ns); assertEquals(localname, ln); }
/** * Taken from Node_URI.getLocalName() * * @return */ public static String getLocalName(String s) { return s.substring(Util.splitNamespaceXML(s)); }
@Override public String getLocalName() { String s = (String) label; return s.substring(Util.splitNamespaceXML(s)); }
/** * Taken from Node_URI.getNameSpace() * * @return */ public static String getNameSpace(String s) { return s.substring(0, Util.splitNamespaceXML(s)); }