krpano uses simple xml text files for storing the settings for the krpano viewer.
These files can be written or edited with any usual texteditor,
but when writting the xml code, it is important that the xml-syntax-rules will be respected!
These basic rules are the same for all xml files and not specific to krpano.
The syntax rules of xml files are simple, logical, easy to learn and easy to use.
So here now the rules:
Note - duplicate attributes on one element are not allowed and will cause a syntax error!
There must be always one, so called 'root-element', in the xml.
This is the hierarchically top-most xml-element. All other xml-elements need to be within it.
For the krpano viewer this element is always the <krpano> element - e.g.:
The names of xml-elements and xml-attributes are case-sensitive.
That means the name of start- and end-elements need to be written in the same case.
Note - for the xml syntax rules the case is very important, but for the krpano viewer itself,
the case of the krpano xml elements doesn't matter - the krpano viewer will automatically convert
all element and attribute names to lower case to make their krpano-usage case-insensitive.
To avoid character encoding problems all xml files should be saved as Unicode UTF-8 or UTF-16 files.
The text-editor will add a small hidden header (called UTF-BOM) at the beginning of the xml file in this case.
Whitespace characters like blanks, tabs and line-breaks between xml-elements and between the xml-attributes will be ignored.
But inside attribute-values they will be respected.
This allows to freely write and structurate the xml in many ways.
But for better readability it often makes sense to indent elements
in a way that make their hierarchical structure more clear.
Some characters are reserved by the xml syntax itself, so they can't be used directly.
To use them anyway there are some replacement-entities that can be used: