Package nu.validator.xml

Examples of nu.validator.xml.AttributesImpl.addAttribute()


                    uri = attributes.getURI(k);
                    local = attributes.getLocalName(k);
                    if (local == "lang" && uri == "http://www.w3.org/XML/1998/namespace") {
                        langValue = attributes.getValue(k);
                    }
                    attributesImpl.addAttribute(uri, local, attributes.getQName(k), attributes.getType(k), attributes.getValue(k));                       
                }
                if (errorHandler != null && !equalsIgnoreAsciiCase(xmlLangValue, langValue)) {
                    errorHandler.error(new SAXParseException("When the attribute \u201Cxml:lang\u201D in no namespace is specified, the element must also have the attribute \u201Clang\u201D present with the same value.", locator));
                }
                return attributesImpl;
View Full Code Here


                if (errorHandler != null) {
                    checkDataName(local);
                }
                AttributesImpl attributesImpl = new AttributesImpl();
                for (int j = 0; j < i; j++) {
                    attributesImpl.addAttribute(attributes.getURI(j), attributes.getLocalName(j), attributes.getQName(j), attributes.getType(j), attributes.getValue(j));
                }
                for (int k = i + 1; k < len; k++) {
                    String uri = attributes.getURI(k);
                    local = attributes.getLocalName(k);
                    if (local.length() > 5 && local.startsWith("data-") && "" == uri) {
View Full Code Here

                    String uri = attributes.getURI(k);
                    local = attributes.getLocalName(k);
                    if (local.length() > 5 && local.startsWith("data-") && "" == uri) {
                        checkDataName(local);
                    } else {
                        attributesImpl.addAttribute(uri, local, attributes.getQName(k), attributes.getType(k), attributes.getValue(k));                       
                    }
                }
                return attributesImpl;
            }
        }
View Full Code Here

        String wrapper = (bad? "b" : "span");
        String highlight = (bad? " highlight" : "");
        if (typeCount > 1 || "value".equals(attributeName)) {
            addText(xhtmlSaxEmitter, " ");
            AttributesImpl attributesImpl = new AttributesImpl();
            attributesImpl.addAttribute("class", "inputattrtypes" + highlight);
            xhtmlSaxEmitter.startElement(wrapper, attributesImpl);
            addText(xhtmlSaxEmitter, "when ");
            xhtmlSaxEmitter.startElement("code");
            addText(xhtmlSaxEmitter, "type");
            xhtmlSaxEmitter.endElement("code", "code");
View Full Code Here

                }
            }
            xhtmlSaxEmitter.endElement(wrapper);
        } else {
            AttributesImpl attributesImpl = new AttributesImpl();
            attributesImpl.addAttribute("class", "inputattrtypes");
            xhtmlSaxEmitter.startElement("span", attributesImpl);
            xhtmlSaxEmitter.endElement("span");
        }
    }
View Full Code Here

    }

    private void addHyperlink(XhtmlSaxEmitter xhtmlSaxEmitter, String text,
            String href) throws SAXException {
        AttributesImpl attributesImpl = new AttributesImpl();
        attributesImpl.addAttribute("href", href);
        xhtmlSaxEmitter.startElement("a", attributesImpl);
        addText(xhtmlSaxEmitter, text);
        xhtmlSaxEmitter.endElement("a");
    }
View Full Code Here

            throws SAXException {
        AttributesImpl attributesImpl = new AttributesImpl();
        for (int i = 0; i < attributes.getLength(); i++) {
            if ("role".equals(attributes.getLocalName(i))
                    && "".equals(attributes.getURI(i))) {
                attributesImpl.addAttribute(
                        attributes.getURI(i),
                        attributes.getLocalName(i),
                        attributes.getQName(i),
                        attributes.getType(i),
                        getFirstMatchingAriaRoleFromTokenList(attributes.getValue(i)));
View Full Code Here

                        attributes.getLocalName(i),
                        attributes.getQName(i),
                        attributes.getType(i),
                        getFirstMatchingAriaRoleFromTokenList(attributes.getValue(i)));
            } else {
                attributesImpl.addAttribute(attributes.getURI(i),
                        attributes.getLocalName(i), attributes.getQName(i),
                        attributes.getType(i), attributes.getValue(i));
            }
        }
        return attributesImpl;
View Full Code Here

            case IN_PROSE:
                String href = null;
                if (NS == uri && "a" == localName) {
                    if ((href = atts.getValue("", "href")) != null) {
                        AttributesImpl ai = new AttributesImpl();
                        ai.addAttribute("href", href);
                        depth++;
                        treeBuilder.startElement(uri, localName, qName, ai);
                    }
                } else if (NS == uri && "div" == localName
                        && ("printfooter".equals(atts.getValue("", "class")))) {
View Full Code Here

                depth++;
                String href = null;
                if (NS == uri && "a" == localName
                        && ((href = atts.getValue("", "href")) != null)) {
                    AttributesImpl ai = new AttributesImpl();
                    ai.addAttribute("href", href);
                    treeBuilder.startElement(uri, localName, qName, ai);
                } else {
                    treeBuilder.startElement(uri, localName, qName,
                            EmptyAttributes.EMPTY_ATTRIBUTES);
                }
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.