【发布时间】:2018-06-19 18:01:11
【问题描述】:
嘿,我在 Java EE 项目上使用 Eclipse,它显示了问题
replace(Element, String) 方法未为该类型定义 输出文档
我已经导入了 au.id.jericho.lib.html.OutputDocument 库,我不知道还能做什么
这就是它的用途
for (Iterator i = linkStartTags.iterator(); i.hasNext();) {
Element el = (Element)i.next();
Attributes attributes = el.getAttributes();
String rel = attributes.getValue(atributo);
if ((rel != null) && (!"".equalsIgnoreCase(rel)))
{
if ((valores != null) &&
(valores.containsKey(rel))) {
String valor = (String)valores.get(rel);
outputDocument.replace(el, valor);
}
}
}
P.S 这段代码不是我写的。
编辑: 我使用了错误版本的库,我使用的是 jericho-html-2.1,我更改为 jericho-html-2.3,现在它可以工作了,谢谢
【问题讨论】:
-
随时发布您的解决方案作为答案。
标签: java eclipse replace document jericho-html-parser