Exemplo n.º 1
0
  public void addAttribute(String nsUri, String localName, Object arg) {
    checkWritable();

    // look for the existing ones
    Attribute a;
    for (a = firstAtt; a != null; a = a.next) {
      if (a.hasName(nsUri, localName)) {
        break;
      }
    }

    // if not found, declare a new one
    if (a == null) {
      a = new Attribute(nsUri, localName);
      if (lastAtt == null) {
        assert firstAtt == null;
        firstAtt = lastAtt = a;
      } else {
        assert firstAtt != null;
        lastAtt.next = a;
        lastAtt = a;
      }
      if (nsUri.length() > 0) addNamespaceDecl(nsUri, null, true);
    }

    document.writeValue(arg, this, a.value);
  }
Exemplo n.º 2
0
 public void visitAttribute(final Attribute attr) {
   attr.next = attrs;
   attrs = attr;
 }