本文整理了Java中org.jsoup.parser.Tag.setSelfClosing()
方法的一些代码示例,展示了Tag.setSelfClosing()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.setSelfClosing()
方法的具体详情如下:
包路径:org.jsoup.parser.Tag
类名称:Tag
方法名:setSelfClosing
暂无
代码示例来源:origin: org.jsoup/jsoup
Element insert(Token.StartTag startTag) {
Tag tag = Tag.valueOf(startTag.name(), settings);
// todo: wonder if for xml parsing, should treat all tags as unknown? because it's not html.
Element el = new Element(tag, baseUri, settings.normalizeAttributes(startTag.attributes));
insertNode(el);
if (startTag.isSelfClosing()) {
if (!tag.isKnownTag()) // unknown tag, remember this is self closing for output. see above.
tag.setSelfClosing();
} else {
stack.add(el);
}
return el;
}
代码示例来源:origin: org.jsoup/jsoup
Element insertEmpty(Token.StartTag startTag) {
Tag tag = Tag.valueOf(startTag.name(), settings);
Element el = new Element(tag, baseUri, startTag.attributes);
insertNode(el);
if (startTag.isSelfClosing()) {
if (tag.isKnownTag()) {
if (!tag.isEmpty())
tokeniser.error("Tag cannot be self closing; not a void tag");
}
else // unknown tag, remember this is self closing for output
tag.setSelfClosing();
}
return el;
}
代码示例来源:origin: abola/CrawlerPack
Element insert(StartTag startTag) {
// remove prefix
Tag tag = Tag.valueOf(startTag.name().replace(this.prefix,""));
Element el = new Element(tag, this.baseUri, startTag.attributes);
this.insertNode(el);
if(startTag.isSelfClosing()) {
this.tokeniser.acknowledgeSelfClosingFlag();
if(!tag.isKnownTag()) {
tag.setSelfClosing();
}
} else {
this.stack.add(el);
}
return el;
}
代码示例来源:origin: astamuse/asta4d
Element insertEmpty(Token.StartTag startTag) {
Tag tag = Tag.valueOf(startTag.name());
Element el = new Element(tag, baseUri, startTag.attributes);
insertNode(el);
if (startTag.isSelfClosing()) {
if (tag.isKnownTag()) {
if (tag.isSelfClosing())
tokeniser.acknowledgeSelfClosingFlag(); // if not acked, promulagates error
} else {
// unknown tag, remember this is self closing for output
tag.setSelfClosing();
tokeniser.acknowledgeSelfClosingFlag(); // not an distinct error
}
}
return el;
}
内容来源于网络,如有侵权,请联系作者删除!