【问题标题】:Java - The method replace() is undefined for the type OutputDocumentJava - 未定义 OutputDocument 类型的方法 replace()
【发布时间】: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


【解决方案1】:

解决方案:

我使用了错误版本的库,我使用的是 jericho-html-2.1,然后我更改为 jericho-html-2.3, 现在它可以工作了,谢谢

【讨论】:

    猜你喜欢
    • 2018-02-18
    • 2016-06-07
    • 1970-01-01
    • 1970-01-01
    • 2014-05-16
    • 2013-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多