![](/img/trans.png)
[英]Provider for javax.xml.parsers.DocumentBuilderFactory cannot be found
[英]setFeature(String, boolean) is undefined for the type javax.xml.parsers.DocumentBuilderFactory
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
builderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
builderFactory.setNamespaceAware(true);`
setNamespaceAware()在DocumentBuilderFactory上工作。 但是setFeature()會出現編譯錯誤。
類型DocumentBuilderFactory的setFeature(String,boolean)方法未定義
解決此問題的任何建議。
我將首先檢查類路徑,以查看DocumentBuilderFactory的來源。 例如,xerces具有javax.xml.parsers.DocumentBuilderFactory類,而沒有setFeature方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.