Beispiel #1
0
  @Override
  protected void attribute(final byte[] name, final byte[] value, final boolean standalone) {
    byte[] prefix = null;
    if (startsWith(name, XMLNS)) {
      if (name.length == 5) {
        prefix = EMPTY;
      } else if (name[5] == ':') {
        prefix = substring(name, 6);
      }
    }

    if (prefix != null) {
      namespaces.put(prefix, value);
    } else {
      attributes.add(name, value);
    }
  }
Beispiel #2
0
 /**
  * Stores a new prefix and namespace.
  *
  * @param prefix prefix
  * @param uri namespace uri
  */
 private void put(final byte[] prefix, final byte[] uri) {
   if (decls == null) decls = new Atts();
   decls.add(prefix, uri);
 }