Esempio n. 1
0
 /**
  * Finds the prefix for the specified uri.
  *
  * @param uri namespace uri
  * @return prefix, or empty string
  */
 public static byte[] prefix(final byte[] uri) {
   for (int s = NS.size() - 1; s >= 0; s--) {
     if (eq(NS.string(s), uri)) return NS.name(s);
   }
   return EMPTY;
 }
Esempio n. 2
0
 /**
  * Finds the specified namespace uri.
  *
  * @param pref prefix of the namespace
  * @return uri, or {@code null}
  */
 public static byte[] uri(final byte[] pref) {
   for (int s = NS.size() - 1; s >= 0; s--) {
     if (eq(NS.name(s), pref)) return NS.string(s);
   }
   return null;
 }