java learnging

          一塊探討JAVA的奧妙吧
          posts - 34, comments - 27, trackbacks - 0, articles - 22

          "Content is not allowed in prolog" error

          Posted on 2005-02-27 11:09 bigseal 閱讀(21002) 評(píng)論(7)  編輯  收藏

                 看到一篇關(guān)于在eclipse中使用ant構(gòu)建java項(xiàng)目的文章,就按照文章中的說(shuō)明新建了一個(gè)項(xiàng)目,并新建了classes,dist,doc,lib幾個(gè)文件夾和build.xml文件。其中build.xml文件的內(nèi)容也是直接復(fù)制的,由于是從網(wǎng)頁(yè)上直接復(fù)制的,里面“<”“>”都是中文格式的,我就把這些給替換了一下。
                   但當(dāng)選中項(xiàng)目,然后選擇“Project”,“Properties”,“Builders”,“New…”,選擇“Ant Build”:載入“Bulidfile”時(shí)提示“Content is not allowed in prolog”錯(cuò)誤。    
                   我就去Google上轉(zhuǎn)了一圈,還有點(diǎn)收獲,看了一篇小文章,覺得可能是build.xml文件格式的錯(cuò)誤。

          In SGML and XML, a document is composed of two sequential parts,
          the prolog and the instance. You can see this in an HTML example:

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN "
          2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " 
          >
          <html xmlns= "http://www.w3.org/1999/xhtml " >
          <head >
          <title >The Symbol Grounding Problem </title >
          </head >
          <body >
          </body >
          </html >

          In this example, the prolog is lines 1-2, the instance begins on
          line 3. The prolog includes the DOCTYPE declaration, the external
          subset (called the DTD), and the internal subset (which you seldom
          see but it 's legal). The document instance includes the document
          element (in this case 
          <html > and all of its descendent content).

          You generally don 't want to see the prolog, and you generally don 't
          want to store it. The DOCTYPE declaration provides references to
          DTD, which is instantiated as part of the process of validating the
          document. You may want to store the reference(s), but you wouldn 't
          want to store the DTD each time you store the document, as that
          would be a real waste (the DTD is often bigger than the document).

          It sounds like your well-formed and valid document isn 't being
          considered as such by the XML processor. The error message indicates
          that there is content (i.e., either elements or character data) in
          the part of the document considered as the prolog. You may be missing
          the last " > " on line 2 above, as that would normally be the beginning
          of the internal subset. If it found " 
          <html " (or something similar),
          you might get that error.
          果然,有兩個(gè)“!”是中文狀態(tài),改過(guò)來(lái)就ok 了。

          Feedback

          # re: "Content is not allowed in prolog" error  回復(fù)  更多評(píng)論   

          2006-11-25 17:54 by jf
          謝謝

          # re: "Content is not allowed in prolog" error  回復(fù)  更多評(píng)論   

          2006-11-30 09:53 by Arcko
          受益
          感謝

          # re: "Content is not allowed in prolog" error[未登錄]  回復(fù)  更多評(píng)論   

          2007-01-31 12:09 by tim
          還看不懂你的意思,

          是中文編碼的"!"嗎,

          看你舉的例子,只有一個(gè)"!"。

          沒有兩個(gè)。

          奇怪!

          # re: "Content is not allowed in prolog" error  回復(fù)  更多評(píng)論   

          2011-05-06 16:20 by luokery
          對(duì), 他的意思就是說(shuō),他的! 是中文的. 現(xiàn)在網(wǎng)頁(yè)上面表現(xiàn)的是正確的.

          # re: "Content is not allowed in prolog" error  回復(fù)  更多評(píng)論   

          2012-05-17 14:01 by s.
          把錯(cuò)誤的行重新編寫,尤其是看不見的字符要?jiǎng)h除。

          # re: "Content is not allowed in prolog" error  回復(fù)  更多評(píng)論   

          2013-03-03 01:17 by TZH123456
          VALIDATE一下(文件上右鍵-VALIDATE)

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 墨竹工卡县| 新余市| 西宁市| 阿尔山市| 洪江市| 腾冲县| 安新县| 页游| 芮城县| 波密县| 温宿县| 清新县| 长垣县| 抚远县| 阳原县| 东兰县| 新源县| 吉林市| 黔西县| 乌鲁木齐县| 孝感市| 丘北县| 五台县| 肥东县| 昭觉县| 馆陶县| 肇州县| 永城市| 荆门市| 乐业县| 蒲江县| 江川县| 个旧市| 红安县| 泰和县| 睢宁县| 平湖市| 西乌珠穆沁旗| 乌苏市| 潍坊市| 鸡东县|