Package org.xml.sax.helpers

Examples of org.xml.sax.helpers.AttributeListImpl.addAttribute()


  if ( _returnAttrs != null ) {
      enumeration = _returnAttrs.elements();
      while ( enumeration.hasMoreElements() ) {
    attrList = new AttributeListImpl();
    attrList.addAttribute( Names.Attribute.AttrName, "NMTOKEN",
               (String) enumeration.nextElement() );
    docHandler.startElement( Names.Element.ReturnAttr, attrList );
    docHandler.endElement( Names.Element.ReturnAttr );
      }
  }
View Full Code Here


        leaveSchema();
        enterDirectory();

        // dsml:entry dn
        attrList = new AttributeListImpl();
        attrList.addAttribute( XML.Entries.Attributes.DN, "CDATA", name );
        // dsml:entry
        _docHandler.startElement( prefix( XML.Entries.Elements.Entry ), attrList );

        if ( attrs != null ) {
            attr = attrs.get( "objectclass" );
View Full Code Here

                // dsml:attr
                attr = (Attribute) enumeration.next();
                if ( attr.getID().equals( "objectclass" ) )
                    continue;
                attrList = new AttributeListImpl();
                attrList.addAttribute( XML.Entries.Attributes.Name, "CDATA", attr.getID() );
                _docHandler.startElement( prefix( XML.Entries.Elements.Attribute ), attrList );

                values = attr.getAll();
                while ( values.hasMore() ) {
                    char[] chars = null;
View Full Code Here

                    if (bytes != null)
                    {
                        MimeBase64Encoder encoder = new MimeBase64Encoder();
                        encoder.translate( bytes );
                        chars = encoder.getCharArray();
                        attrList.addAttribute( XML.Entries.Attributes.Encoding, "NMTOKEN",
                                               XML.Entries.Attributes.Encodings.Base64 );
                    }
                    _docHandler.startElement( prefix( XML.Entries.Elements.Value ), attrList );
                    _docHandler.characters( chars, 0, chars.length );
                    _docHandler.endElement( prefix( XML.Entries.Elements.Value ) );
View Full Code Here

            for (int x=0; x<this.undecl.size(); x++) {
                NamespacesTable.Declaration dec=null;
                dec=(NamespacesTable.Declaration)this.undecl.elementAt(x);
                String aname="xmlns";
                if (dec.getPrefix().length()>0) aname="xmlns:"+dec.getPrefix();
                a2.addAttribute(aname,"CDATA",dec.getUri());
            }
            this.undecl.clear();
        }
        // Set the real attributes
        for (int x=0; x<a.getLength(); x++) {
View Full Code Here

        for (int x=0; x<a.getLength(); x++) {
            NamespacesTable.Name aname=namespaces.resolve(a.getURI(x),
                                                          a.getQName(x),
                                                          null,
                                                          a.getLocalName(x));
            a2.addAttribute(aname.getQName(),a.getType(x),a.getValue(x));
        }
        // Call the document handler startElement() method.
        this.documentHandler.startElement(name.getQName(),a2);
    }
View Full Code Here

    case Node.ELEMENT_NODE:
        NamedNodeMap map = currentNode.getAttributes();
        currentAtts.clear();
        for (int i = map.getLength() - 1; i >= 0; i--) {
      Attr att = (Attr)(map.item(i));
      currentAtts.addAttribute(att.getName(),
             "CDATA",
             att.getValue());
        }
        this.treeBuilder.startElement(
      currentNode.getNodeName(), currentAtts);
View Full Code Here

                        throw new SAXException( "No attribute prefix for namespace URI: " + attributeNamespaceURI );
                    }
                    attributeName = prefix + ':' + attributeLocalName;
                }
            }
            attributeList.addAttribute( attributeName, a.getType( i ), a.getValue( i ) );
        }

        final Enumeration e = m_support.getDeclaredPrefixes();
        while( e.hasMoreElements() )
        {
View Full Code Here

        while( e.hasMoreElements() )
        {
            final String prefix = (String)e.nextElement();
            if( prefix.length() == 0 )
            {
                attributeList.addAttribute( XMLNS, CDATA, uri );
            }
            else
            {
                attributeList.addAttribute( XMLNS_PREFIX + prefix, CDATA, uri );
            }
View Full Code Here

            {
                attributeList.addAttribute( XMLNS, CDATA, uri );
            }
            else
            {
                attributeList.addAttribute( XMLNS_PREFIX + prefix, CDATA, uri );
            }
        }

        m_documentHandler.startElement( name, attributeList );
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.