Eclipse 中 XML 警告 No grammar constraints (DTD or XML Schema) 解決方法

警告提示如下: 
Description Resource Path Location Type 
No grammar constraints (DTD or XML Schema) referenced in the document. *.xml /XXXProject line 1 XML Problem

解決方法【2 選 1,推薦 2,符合標準】:

  1. 在 window -> preferences 中修改 XML “No grammar specified” 警告爲“忽略” 

  2. 在第一行的(如下)XML 定義下添加 DOCTYPE 
    參考資料:XML DTD

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd">
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章