Package net.sourceforge.jivalo.xmlparser.parser

Examples of net.sourceforge.jivalo.xmlparser.parser.AttributesEx


        throws DOMException
    {
        AttributeSet retval = new AttributeSet();

        int len = source.getLength();
        AttributesEx ex = null;

        retval.list = new Vector(len);
        if (source instanceof AttributesEx) {
            ex = (AttributesEx) source;
        }

        for (int i = 0; i < len; i++) {

            // Process the namespaceURI according to DOM Level 2 spec
            String uri;
            String qName = source.getQName(i);
            if ("xmlns".equals(qName)
                || "xmlns".equals(XmlNames.getPrefix(qName))) {
                // Associate the right namespaceURI with "xmlns" attributes
                uri = XmlNames.SPEC_XMLNS_URI;
            } else {
                uri = source.getURI(i);
                // Translate "" of SAX2 to null.  See DOM2 spec under Node
                // namespaceURI
                if ("".equals(uri)) {
                    uri = null;
                }
            }

            AttributeNode attrNode =
                new AttributeNode(uri, qName,
                                  source.getValue(i),
                                  ex == null    // remember if it was specified
                                  ? true
                                  : ex.isSpecified(i),
                                  ex == null    // remember any default value
                                  ? null
                                  : ex.getDefault(i));
            retval.list.addElement(attrNode);
        }
        return retval;
    }
View Full Code Here


        throws DOMException
    {
        AttributeSet retval = new AttributeSet();

        int len = source.getLength();
        AttributesEx ex = null;

        retval.list = new Vector(len);
        if (source instanceof AttributesEx) {
            ex = (AttributesEx) source;
        }

  for (int i = 0; i < len; i++) {
            AttributeNode1 attrNode1 = new AttributeNode1(
                source.getQName(i),
                source.getValue(i),
                ex == null  // remember if it was specified
                    ? true
                    : ex.isSpecified(i),
                ex == null  // remember any default value
                    ? null
                    : ex.getDefault(i));
      retval.list.addElement(attrNode1);
  }
        return retval;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.jivalo.xmlparser.parser.AttributesEx

Copyright © 2018 www.massapicom. 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.