2011-06-11 71 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中完成的所有格式。