Check for krpano syntax errors

Source: Internet
Author: User


A friend who just got in touch with krpano may initially want to watch the panoramic view on his mobile phone. krpano's two sets of viewer, Flash and HTML5, meet cross-platform requirements, in addition, the same address can be viewed on the computer and mobile phone, so our friends are very happy to see the excellent panoramic effect on the computer, but when the address is opened on the mobile phone, but the above black screen is displayed. What does it mean? Fatal error, fatal error,
Why? Clearly visible on the computer, the phone is fatal! This is because krpano may use the Flash kernel based on your settings on the computer, while HTML5 is used on mobile phones. HTML5 checks the xml syntax more strictly than Flash checks the xml syntax, errors that are ignored in Flash will not be missed in front of HTML5.
What should we do in this situation? Drag the xml file directly to your pc browser. For example, drag the xml file to your pc browser. The following information appears in the browser.

This page contains the following errors:error on line 30 at column 44: Attribute name redefinedBelow is a rendering of the page up to the first error.

We only need to know that this is a 30th row error and it is an Attribute name redefined error. What does this mean? Do not mention it for the moment. Open the xml file to see what row 30th is.
<layer name="skin_logo" name="skin_logo" url="" scale="0.25" opened_onclick="openurl('http://www.shendu360.net/',_blank);" />

Read the code carefully and you can see that there are two definitions of name, that is, repeated definitions. This is also the meaning of Attribute name redefined, at this time, you only need to delete one of the names = "skin_logo". At this time, we refresh the xml file in the browser and find that the error message is missing. We can see the complete xml code.
Below I will list some common xml syntax errors.
First, repeat the definition of the attribute just now, for example
<plugin name="test" url="image.png" keep="true" visible="true" keep="false" /> 

Also
<plugin menu="true" name="test"><menu name="testmenu" color="0xFFFFFF" /></plugin>

Plugin [test]. menu can be testmenu or true, which is not allowed.

This page contains the following errors:error on line 26 at column 1: error parsing attribute nameBelow is a rendering of the page up to the first error.

This may be because the related labels are not closed, that is, they do not conform to the following syntax:
<plugin name="test"></plugin> 

Or
<plugin name="test" /> 

The following error occurs especially when the layer label is faulty.
This page contains the following errors:error on line 244 at column 10: Opening and ending tag mismatch: layer line 0 and krpanoBelow is a rendering of the page up to the first error.

At this time, check whether the layer is not closed.
The annotation part is also error-prone and must comply with the following statement:
<!-- activated spot image (zorder=3 and hidden at start) -->

There are no spaces, such
keep="true"visible="false"

Which of the following statements is true?
keep="true" visible="false"

The xml language also stipulates that some characters cannot be used at will, and they have corresponding replacement characters,
&  -  &amp;<  -   &lt;>  -   &gt;"   -   &quot;'    -   &#39;


Of course, it is like a semicolon; there is also a comma, which is also prone to errors.
As long as the above method is used for troubleshooting until a complete xml file is displayed, your code will basically have no Syntax problems.

Technical support and requirements:

Please contact QQ 178941086 to indicate"Blog"

Please follow the subscription No. krpano



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.