如何使用java7的org.w3c.dom.html包而不是Jsoup解析HTMLDocument?

如何使用java7的org.w3c.dom.html包而不是Jsoup解析HTMLDocument?,java,html-parsing,jsoup,w3c,Java,Html Parsing,Jsoup,W3c,在我的项目中,我曾使用jsoup解析html文档并对其进行处理,但现在我知道java 7有w3c org.w3c.dom.html可用于处理html文档,但没有教程或其他帮助内容可供使用,因此请帮助我找到此jsoup代码的替代代码 File in = new File("index.html"); Document doc = Jsoup.parse(in, null); Element form = doc.select("form").first(); Ele

在我的项目中,我曾使用jsoup解析html文档并对其进行处理,但现在我知道java 7有w3c org.w3c.dom.html可用于处理html文档,但没有教程或其他帮助内容可供使用,因此请帮助我找到此jsoup代码的替代代码

    File in = new File("index.html");
    Document doc = Jsoup.parse(in, null);
    Element form = doc.select("form").first();
    Elements in=doc.getElementsByTag("input");
    for(Element el:in){
        el.attr("value", "23");
    }

Jsoup是我的项目中唯一的externel包,所以我想用java7的现有功能替换它。

Jsoup很棒-为什么要替换它

编辑:

也许这会有帮助:

这是我的大学项目,我想避免使用任何外部库,这就是为什么我要尝试使用上面的代码对w3c org.w3c.dom.html HTMLDocument执行相同的操作,我只需要另一个代码,因为在互联网上我找不到w3c包的代码。这个链接没有帮助,因为他们使用了//Docuverse imports import com.Docuverse.dom.dom;导入com.docuverse.dom.html.HTMLFactory;这也是外部图书馆