public XmlSerializer attribute (String namespace, String name,
                                    String value) throws IOException
    {
        if(!startTagIncomplete) {
            throw new IllegalArgumentException("startTag() must be called before attribute()"+getLocation());
        }
        //assert setPrefixCalled == false;
        out.write(' ');
        ////assert namespace != null;
        if(namespace != null && namespace.length() > 0) {
            //namespace = namespace.intern();
            if(!namesInterned) {
                namespace = namespace.intern();
            } else if(checkNamesInterned) {
                checkInterning(namespace);
            }
            String prefix = lookupOrDeclarePrefix( namespace );
            //assert( prefix != null);
            if(prefix.length() == 0) {
                // needs to declare prefix to hold default namespace
                //NOTE: attributes such as a='b' are in NO namespace
                prefix = generatePrefix(namespace);
            }
            out.write(prefix);
            out.write(':');
            //            if(prefix.length() > 0) {
            //                out.write(prefix);
            //                out.write(':');
            //            }
        }
        //assert name != null;
        out.write(name);
        out.write('=');
        //assert value != null;
        out.write( attributeUseApostrophe ? '\'' : '"');
        writeAttributeValue(value, out);
        out.write( attributeUseApostrophe ? '\'' : '"');
        return this;
    }