Package com.quiotix.html.parser.HtmlDocument

Examples of com.quiotix.html.parser.HtmlDocument.Attribute


            return true;
    }

    public void visit(HtmlDocument.Tag t) {
        if (t.tagName.equalsIgnoreCase("A")) {
            Attribute href = getAttribute(t, "HREF");
            if (href != null)
                visitHref(t, href);
        }
    }
View Full Code Here


        }
    }

    public void visitHref(HtmlDocument.Tag t, Attribute href) {

        Attribute cssClass = getAttribute(t, "CLASS");
        if (cssClass == null) return;
        if (!MAGIC_CLASS.equalsIgnoreCase(deQuote(cssClass.value))) return;

        URL url = resolveURL(href);
        if (shouldFollow(url)) {
View Full Code Here

    }

    public static Attribute getAttribute(HtmlDocument.Tag t, String attrName) {
        Iterator i=t.attributeList.attributes.iterator();
        while (i.hasNext()) {
            Attribute attr = (Attribute) i.next();
            if (attr.name.equalsIgnoreCase(attrName))
                return attr;
        }
        return null;
    }
View Full Code Here

    }

    private static final String CROSS_REF_STARTER = "mso-field-code:\"REF ";
    public static String getCrossReference(HtmlDocument.Tag t,
                                           String insertPrefix) {
        Attribute style = HTMLSpider.getAttribute(t, "STYLE");
        if (style == null) return null;
        String s = style.value;
        // only handle cross references to paragraph numbers for now
        if (s.indexOf("\\r") == -1) return null;
        int beginPos = s.indexOf(CROSS_REF_STARTER);
View Full Code Here

        // or should we always default it unless it has been specified?
        // docStatus = that.docStatus;
        docStatus = DEFAULT_DOC_STATUS;
        headingIncrement = that.headingIncrement;

        Attribute demote = getAttribute(t, "demoteTo");
        if (demote != null) try {
            headingIncrement += Integer.parseInt(deQuote(demote.value)) - 1;
        } catch (NumberFormatException nfe) {
        }
    }
View Full Code Here

        // status division, restart it.
        if (!inDocumentDivision) startDocumentDivision();
    }

    public void visitAnchor(HtmlDocument.Tag t) {
        Attribute name = getAttribute(t, "NAME");
        if (name != null) {
            URL anchorUrl = resolveHash(name);
            String anchorName = getAnchorName(anchorUrl);
            if (anchorName != null) {
                setAttribute(name, anchorName);
View Full Code Here

    public void visitSpan(HtmlDocument.Tag t) {
        CrossReferencer.getCrossReference(t, docID + "_");
    }

    public void visitImg(HtmlDocument.Tag t) {
        Attribute src = getAttribute(t, "SRC");
        if (src != null) try {

            URL imageURL = resolveURL(src);
            if (imageURL == null) return;
View Full Code Here

        int width = image.getWidth();
        int height = image.getHeight();
       
        if (!widthSet) {
            t.attributeList.addAttribute(
                new Attribute("width", "\"" + width + "\""));
        }
       
        if (!heightSet) {
            t.attributeList.addAttribute(
            new Attribute("height", "\"" + height + "\""));
        }
    }
View Full Code Here

        setAttribute(src, newSrc);

    }
    public void visitMeta(HtmlDocument.Tag t) {
        if (DEFAULT_DOC_STATUS == STATUSES_DISABLED) return;
        Attribute a = getAttribute(t, "NAME");
        if (a == null) return;
        if ("Generator".equalsIgnoreCase(deQuote(a.value))) {
            a = getAttribute(t, "content");
            if (a != null && a.value.indexOf("Microsoft") != -1)
                printComments = false;
View Full Code Here

        super.openURL(u);
    }

    public void visit(HtmlDocument.Tag t) {
        if (t.tagName.equalsIgnoreCase("A")) {
            Attribute name = getAttribute(t, "NAME");
            if (name != null) {
                String anchorName = deQuote(name.value);
                URL anchorUrl = resolveHash(name);
                if (anchorUrl != null)
                    anchorMap.put(normalizeURL(anchorUrl),
View Full Code Here

TOP

Related Classes of com.quiotix.html.parser.HtmlDocument.Attribute

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.