Package org.jsoup.nodes

Examples of org.jsoup.nodes.Element.attr()


            } else if (tagName.equals(TAG_OBJECT)) {
                extractAttribute(tag, ATT_CODEBASE);
                extractAttribute(tag, ATT_DATA);
            } else if (tagName.equals(TAG_INPUT)) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.attr(ATT_TYPE))) {
                    // then we need to download the binary
                    extractAttribute(tag, ATT_SRC);
                }
            } else if (tagName.equals(TAG_SCRIPT)) {
                extractAttribute(tag, ATT_SRC);
View Full Code Here


                extractAttribute(tag, ATT_SRC);
            } else if (tagName.equals(TAG_BGSOUND)){
                extractAttribute(tag, ATT_SRC);
            } else if (tagName.equals(TAG_LINK)) {
                // Putting the string first means it works even if the attribute is null
                if (STYLESHEET.equalsIgnoreCase(tag.attr(ATT_REL))) {
                    extractAttribute(tag, ATT_HREF);
                }
            } else {
                extractAttribute(tag, ATT_BACKGROUND);
            }
View Full Code Here

                extractAttribute(tag, ATT_BACKGROUND);
            }


            // Now look for URLs in the STYLE attribute
            String styleTagStr = tag.attr(ATT_STYLE);
            if(styleTagStr != null) {
                HtmlParsingUtils.extractStyleURLs(baseUrl.url, urls, styleTagStr);
            }
        }
View Full Code Here

            } else if (tagName.equals(TAG_OBJECT)) {
                extractAttribute(tag, ATT_CODEBASE);               
                extractAttribute(tag, ATT_DATA);                
            } else if (tagName.equals(TAG_INPUT)) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.attr(ATT_TYPE))) {
                    // then we need to download the binary
                    extractAttribute(tag, ATT_SRC);
                }
            } else if (tagName.equals(TAG_SCRIPT)) {
                extractAttribute(tag, ATT_SRC);
View Full Code Here

                extractAttribute(tag, ATT_SRC);
            } else if (tagName.equals(TAG_BGSOUND)){
                extractAttribute(tag, ATT_SRC);
            } else if (tagName.equals(TAG_LINK)) {
                // Putting the string first means it works even if the attribute is null
                if (STYLESHEET.equalsIgnoreCase(tag.attr(ATT_REL))) {
                    extractAttribute(tag, ATT_HREF);
                }
            } else {
                extractAttribute(tag, ATT_BACKGROUND);
            }
View Full Code Here

                extractAttribute(tag, ATT_BACKGROUND);
            }


            // Now look for URLs in the STYLE attribute
            String styleTagStr = tag.attr(ATT_STYLE);
            if(styleTagStr != null) {
                HtmlParsingUtils.extractStyleURLs(baseUrl.url, urls, styleTagStr);
            }
        }
View Full Code Here

            if (tagName.equals(TAG_BODY)) {
                extractAttribute(tag, ATT_BACKGROUND);
            } else if (tagName.equals(TAG_SCRIPT)) {
              extractAttribute(tag, ATT_SRC);
            } else if (tagName.equals(TAG_BASE)) {
                String baseref = tag.attr(ATT_HREF);
                try {
                    if (!StringUtils.isEmpty(baseref))// Bugzilla 30713
                    {
                        baseUrl.url = ConversionUtils.makeRelativeURL(baseUrl.url, baseref);
                    }
View Full Code Here

        assertThat( actualLinks ).hasSize( expectedLinks.size() );

        for ( int i = 0; i < actualLinks.size(); i++ )
        {
            Element element = actualLinks.get( i );
            assertEquals( "Link[" + i + "]", expectedLinks.get( i ), element.attr( "href" ) );
        }
    }

}
View Full Code Here

    int totalwidth = 0;
    for(int i=0;i<maxColumns;i++){
      Element col = colgroup.appendElement("col");
//      System.out.println(sheet.getColumnWidth(i)+":"+MIN_COLUMN_EXCEL_WIDTH);
      if(sheet.getColumnWidth(i)<MIN_COLUMN_EXCEL_WIDTH){
        col.attr("width",String.valueOf(DEFAULT_COLUMN_WIDTH));
        totalwidth+=DEFAULT_COLUMN_WIDTH;
//        css(col,"width",String.valueOf(DEFAULT_COLUMN_WIDTH)+"px");
      }else{
        int widthPx = widthUnits2Pixel(sheet.getColumnWidth(i));
        col.attr("width",String.valueOf(widthPx));
View Full Code Here

        col.attr("width",String.valueOf(DEFAULT_COLUMN_WIDTH));
        totalwidth+=DEFAULT_COLUMN_WIDTH;
//        css(col,"width",String.valueOf(DEFAULT_COLUMN_WIDTH)+"px");
      }else{
        int widthPx = widthUnits2Pixel(sheet.getColumnWidth(i));
        col.attr("width",String.valueOf(widthPx));
        totalwidth+=widthPx;
//        css(col,"width",String.valueOf(widthUnits2Pixel(sheet.getColumnWidth(i)))+"px");
      }
     
    }
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.