2011-06-11 70 views
0

有人可以給我一個想法是什麼,我做錯了XML錯誤,當我運行XML

The XML page cannot be displayed 
Cannot view XML input using style sheet. 
Please correct the error and then click the efresh  
Button, or try again later. 


A name contained an invalid character. 
Error processing resource 
'file:///C:/Users/Randy/Desktop/faq.xml'. Line 1, Positio... 

<?xmlversion"1.0"?encoding="UTF-8" standalone="yes"?> 
------------^ 

<?xml version="1.0"? encoding="UTF-8" standalone="yes"?> 
"ScanMaster and DigiCam FAQ" 
"Randy White 6/11/2011" 
<FAQ> 
/* 
New Perspectives on XML 
Tutorial 1 
Case Problem 1 
Filename: faq.css 

This file contains styles used in the faq.xml file. 

*/ 
</FAQ> 
FAQ  {margin-top: 10px} 
title {display: block; width: 500px; font-family: Arial, Helvetica, Sans-serif; 
     font-size: 18pt; 
     margin-left: 20px} 

subtitle {display: block; width: 500px; font-family: Arial, Helvetica, Sans-serf; 
     font-size:14pt; font-style:italic; 
     margin-left: 20px} 

product {display: block; width: 500px; background-color: ivory; 
     border: solid 2px black; margin-bottom: 20px; padding: 10px; 
     margin-left: 10px} 

model {display: block; width: 500px; font-family: Arial, Helvertica, Sans-serif; 
     font-size: 14pt; color:blue; 
     margin-left: 10px; margin-top: 5px} 

question {display: list-item; list-style-type: disc; width: 500px; 
     margin-left: 30px; margin-top: 10px} 

answer {display:block; width: 450px; font-family: Times New Roman, Times, Serif; 
     color: green; 
     margin-left: 35px} 
+0

如果您要告訴哪個程序顯示錯誤消息「XML頁面無法顯示......」,這將有所幫助。 IE瀏覽器?沒有進一步的解釋,「運行一個XML文檔」是非常沒有意義的。 – LarsH 2011-06-11 16:56:07

+0

IE8是我正在運行的Web瀏覽器 – user770022 2011-06-11 17:00:42

回答

1

用這個替換第一行。你會看到不同之處。空格和=缺失。

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
+0

無法顯示XML頁面 無法使用樣式表查看XML輸入。請更正錯誤,然後點擊刷新按鈕,或稍後再試。 ----------------------------------------------- --------------------------------- 在文檔頂層無效。錯誤處理資源'file:/// C:/ Users/Randy/Documents/School/XML/Week1/Case ... <?xml version =「1.0」encoding =「UTF-8」standalone =「yes」 ?> 這是我現在得到的 – user770022 2011-06-11 16:56:29

1

不應有encoding之前是一個問號。

這也可能是該行中的一個空格實際上是一個非破空間,字符代碼&#xA0;,而不是常規空格,&#x20;

0

關於你越來越...現在沒有很好地形成 你的XML文檔的錯誤,在應該有頂級元素(<FAQ>)外沒有文本內容。你有頂級元素之前的文本內容,如

"ScanMaster and DigiCam FAQ" 

,和文字內容,如

FAQ  {margin-top: 10px} 

在XML文檔中,頂層元素之外允許的唯一節點類型是註釋和處理指令。 (當然了序幕,但是這不是一個節點。)

0

如果修改原始XML 字,然後複製並保存在word.Use Unicode文本文檔選項保存的文本文檔,而不是其他選項如豐富的文本格式。使用Unicode文本文檔選項可以刪除我們在Word中完成的所有格式。