当前位置: 首页>>代码示例>>Java>>正文


Java DocumentType类代码示例

本文整理汇总了Java中org.jsoup.nodes.DocumentType的典型用法代码示例。如果您正苦于以下问题:Java DocumentType类的具体用法?Java DocumentType怎么用?Java DocumentType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DocumentType类属于org.jsoup.nodes包,在下文中一共展示了DocumentType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: matches

import org.jsoup.nodes.DocumentType; //导入依赖的package包/类
@Override
public boolean matches(Element root, Element element) {
      	List<Node> family = element.childNodes();
          for (Node n : family) {
              if (!(n instanceof Comment || n instanceof XmlDeclaration || n instanceof DocumentType)) return false;
          }
      	return true;
}
 
开发者ID:cpusoft,项目名称:common,代码行数:9,代码来源:Evaluator.java

示例2: matches

import org.jsoup.nodes.DocumentType; //导入依赖的package包/类
@Override
public boolean matches(Element root, Element element) {
      	List<Node> family = element.childNodes();
      	for (int i = 0; i < family.size(); i++) {
      		Node n = family.get(i);
      		if (!(n instanceof Comment || n instanceof XmlDeclaration || n instanceof DocumentType)) return false; 
      	}
      	return true;
}
 
开发者ID:rogerxaic,项目名称:gestock,代码行数:10,代码来源:Evaluator.java

示例3: main

import org.jsoup.nodes.DocumentType; //导入依赖的package包/类
public static void main(String args[]){
	Document doc = Document.createShell("");
	DocumentType type = new DocumentType("html","","","");
	doc.prependChild(type);
	Header h = new Header(doc);
	h.addTitle("Yes sir!");
	String[] a= {"rel", "bb", "size", "100p", "href", "kjasldlasjd"};
	h.addlink(a);
	h.addMeta("hell", "yes");
	System.out.println(doc);
}
 
开发者ID:arscyper,项目名称:adan,代码行数:12,代码来源:Header.java

示例4: ScheduleDocument

import org.jsoup.nodes.DocumentType; //导入依赖的package包/类
public ScheduleDocument(){
	doc = Document.createShell("");
	doc.outputSettings().escapeMode(EscapeMode.xhtml);
	DocumentType type = new DocumentType("html", "", "", "");
	doc.prependChild(type);
	doc.select("html").attr("class", "js no-touch geolocation backgroundsize csstransforms csstransforms3d audio localstorage inlinesvg pointerevents webaudio mediaqueries getusermedia");
	
}
 
开发者ID:arscyper,项目名称:adan,代码行数:9,代码来源:ScheduleDocument.java

示例5: modifyBootstrapPage

import org.jsoup.nodes.DocumentType; //导入依赖的package包/类
@Override
public void modifyBootstrapPage(BootstrapPageResponse response) {

    Document document = response.getDocument();

    Element html = document.getElementsByTag("html").get(0);
    Element head = document.getElementsByTag("head").get(0);

    DocumentType doctype = (DocumentType) html.previousSibling();
    DocumentType html5doc = new DocumentType("html", "", "", "");
    doctype.replaceWith(html5doc);

    Element element = document.createElement("meta");
    element.attr("name", "viewport");
    StringBuilder content = new StringBuilder();
    boolean open = false;
    open = addViewPortRule(content, open, "width", getViewPortWidth());
    if (!isViewPortUserScalable()) {
        open = addViewPortRule(content, open, "user-scalable", "no");
    }
    open = addViewPortRule(content, open, "initial-scale",
            getViewPortInitialScale());
    open = addViewPortRule(content, open, "maximum-scale",
            getViewPortMaximumScale());
    open = addViewPortRule(content, open, "minimum-scale",
            getViewPortMaximumScale());
    element.attr("content", content.toString());
    head.appendChild(element);

    // meta tag to disable gray tap highlights in WP8 (note, for some reason
    // these do not appear in W8, not even RT)
    // <meta name="msapplication-tap-highlight" content="no" />
    element = document.createElement("meta");
    element.attr("name", "msapplication-tap-highlight");
    element.attr("content", "no");
    head.appendChild(element);

}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:39,代码来源:ViewPortSettings.java


注:本文中的org.jsoup.nodes.DocumentType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。