krpano语法在浏览器中的检查方法

我们常常遇到这种情况,全景在手机上显示黑屏,通常这都是因为语法错误所导致的。我们需要避免krpano的语法错误。一个办法是将xml文件直接拖拽到浏览器中,如果没有错误,会显示完整的xml代码。如果有错误就会显示如下的提示信息。

This page contains the following errors:

error on line 14 at column 1: Extra content at the end of the document

原因解析krpano xml文件的内容需要由krpano根元素包含,也就是文档内容的一头一尾必须包含krpano元素,通常这种错误的出现,就是头尾缺乏正确的krpano元素标签,可能是少写了或者多写了krpano标签。


This page contains the following errors:

error on line 290 at column 10: Opening and ending tag mismatch: scene line 0 and krpano

原因解析:元素的标签必须正确闭合,在第290行发现结尾的<scene>标签应该写为</scene>。


This page contains the following errors:

error on line 200 at column 2: internal error

原因解析:在200行发现错误的注释写法,应该写为(以<!–开始,以 –>结束,中间不包含 –)<!– fly the hotspot out/back –>


 

This page contains the following errors:

error on line 87 at column 37: EntityRef: expecting ‘;’

原因解析:87行直接使用了保留字符

  • 部分字符在xml语法中是保留字符,因此不能直接使用。
    你需要用指定的字符串进行替换:

    禁止字符 替换方式 字符描述
    < &lt; 小于
    > &gt; 大于
    & &amp;
    &apos; 单引号
    &quot; 双引号

This page contains the following errors:

error on line 91 at column 16: AttValue: ” or ‘ expected

原因解析:91行的属性的数值没有用引号括起来,<item caption=KRPANO separator=”true” /> 应该写为 <item caption=”KRPANO” separator=”true” />


This page contains the following errors:

error on line 91 at column 34: Attribute caption redefined

原因解析:91行的属性定义重复了,写了两次caption=”KRPANO”,也就是<item caption=”KRPANO” caption=”KRPANO” separator=”true” />,应该去掉一个。


 

This page contains the following errors:

error on line 91 at column 16: attributes construct error

原因解析:91行的属性之间没有空格。<item caption=”KRPANO”separator=”true” />

发表评论