[英]Parsing a DTD in Java
加載DTD
語法時,出現以下錯誤:
“未知協議c”。
誰能幫忙解決這個錯誤?
XMLInputSource is = new XMLInputSource(null, dtdPath, null);
Hashtable temp = new Hashtable();
SymbolTable st = new SymbolTable();
DTDHandler handler = new DTDHandler();
XMLDTDLoader loader = new XMLDTDLoader(st);
loader.setDTDHandler(handler);
[![enter image description here][1]][1]
try {
Grammar grammar = loader.loadGrammar(is);
協議是URI / URL的第一部分的技術術語,例如在“ http:...”和“ jdbc:...”中,協議分別是http
和jdbc
。
現在,由於您的錯誤,我們出現了c:
聽起來好像您給了一個預期URL的文件路徑 : file://c:/.../...
類File具有toURI。
使用DTD時,也有PUBLIC和SYSTEM URI。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.