XML-Metadata
Aus EnigmaWiki
Available languages: Deutsch, English, Русский
Meta data is information about the level, for example: Level name, author, version, license, Enigma version etc. With Enigma levels this data is made in XML between the tags <el:info ...> and </el:info>. This looks like the following:
<el:info el:type="level"> <el:identity el:title="Hello world" el:subtitle="My first level" el:id="20061215weihnachtsmann523"/> <el:version el:score="1" el:release="1" el:revision="0" el:status="experimental"/> <el:author el:name="Saint Nicholas" el:email="weihn@chtsma.nn" el:homepage="http://enigma.mal2.ch"/> <el:copyright>Copyright (c) 2006 Saint Nicholas </el:copyright> <el:license el:type="GPL v2.0 or above" el:open="true"/> <el:compatibility el:enigma="1.00"/> <el:modes el:easy="false" el:single="true" el:network="false"/> <el:comments> <el:credits el:showinfo="true" el:showstart="true"> Thanks to the Elves, who tested this level. </el:credits> <el:dedication el:showinfo="true" el:showstart="true"> For Rudolph with the red nose, which always shines the way for me. </el:dedication> <el:code> notes to the code, e.g. To-Do list or version references </el:code> </el:comments> <el:update el:url="http://mein-server.org/pfad/zum/level.xml"/> <el:upgrade el:url="http://mein-server.org/pfad/zum/level_v2.xml" el:release="2"/> <el:score el:easy="00:23" el:difficult="00:55"/> </el:info>
Inhaltsverzeichnis |
Very short XML Crash course
XML elements are noted in the following patterns:
<element> element contents </element>
or
<element/>
for an element without contents.
To elements attributes can also be assigned, as follows:
<element attribut1="value1" attribut2="value2"> element contents </element>
and/or
<element attribut1="value1" attribut2="value2"/>
Moreover, it is to be noted that element contents can consist both of text and of further elements.
If you like to know more about XML, I recommend to you the XML documentation of Selfhtml [1] (german site)
The data
el:identity
<el:identity el:title="Hello world" el:subtitle="My first level" el:id="20061215weihnachtsmann523"/>
This indication is required, i.e., a level without el:identity is not a "valid" level and produces an error message.
el:identity of the level contains title, subtitle and Level-ID.
Attribute
-
el:title(required): The title of the level -
el:subtitle(required): The sub-title of the level -
el:id(required): The ID-String of the Level. Theoretically any string can be entered here. It is however recommended to use the formYYYYMMDDauthorXXX.YYYYMMDDstands for Year-Month-Day and in place ofauthoryou can enter your name.XXXare three random numbers, which you can select freely. They guarantee that two levels written by you on the same day have a clear ID. If you write more than 999 levels on day, you should add yourself an alias ;-)
Element contents
This element does not have contents.
el:version
<el:version el:score="1" el:release="1" el:revision="0" el:status="experimental"/>
required
el:version contains information of the version of the level.
Attribute
-
el:score(required): This number is increased each time by one, if the level changed to its predecessor so strongly that the Best Time is no longer comparable. New levels start with the value 1. -
el:release(required): This number is increased each time by one, if the level were changed in such a way that it is no longer compatible to earlier Enigma versions, or if el:score was increased. New levels start with the value 1. -
el:revision(required): This number is increased each time by one, if a new version of the level is published. -
el:status(required): Can take the values "released", "stable", "test" and "experimental". At the beginning the status is set on experimental. If the writing of the level is finished, but not put through its paces, it receives the status test. If the level does not have any more bugs, you may set it on stable.
Element contents
This element does not have contents.
el:author
<el:author el:name="Saint Nicholas" el:email="weihn@chtsma.nn" el:homepage="http://enigma.mal2.ch"/>
required
el:author contains information of the Level authors
Attribute
-
el:name(optional): Here you can register your name. If you omits this attribute, the value is automatically assigned to "anonymous". -
el:email(optional): Here you can register your email address, or alternatively a newsgroup or forum, in which you can be reached. The address is indicated on the level info page. -
el:homepage(optional): If you want, you can indicate your homepage address. It is then indicated on the level info page.
Element contents
This element does not have contents.
el:copyright
<el:copyright>Copyright (c) 2006 Saint Nicholas </el:copyright>
required
el:copyright contains information of the copyright
Attribute
This element does not have attributes
Element contents
A short copyright notice with year and copyright owner.
el:license
<el:license el:type="GPL v2.0 or above" el:open="true"/>
required
el:license contains information of the license under which the level is published.
Attribute
-
el:type(required): The name of the license and possibly a link to the license text. If you want to use your own license, which you indicate in element contents, this attribute is set on "special". -
el:open(required): Is "true", if the license is free under the criteria of the Open Source Initiative (OSI)[2]. If the license is not free, the attribute obtains the value "false". Levels, which are not published under a free license, cannot be integrated into the official Enigma level packs.
Element contents
If your el:type is set on "special", you can indicate your own license as element contents.
el:compatibility
<el:compatibility el:enigma="1.00"/>
required
el:compatibility gives information of the Enigma version and engine, under that the level runs to the necessary Lua libraries.
Attribute
-
el:enigma(required): The Enigma version which can be used is indicated. -
el:engine(optional): The engine which can be used is indicated. Possible values are "enigma", "oxyd1", "per.oxyd" "oxyd.extra" and "oxyd.magnum", which all differ in the handling of different objects. By default the "enigma" engine is used. This attribute can be used only with levels and not with level packages.
Element contents
see XML-Metadata/el:compatibility for child-elements.
el:modes
<el:modes el:easy="false" el:single="true" el:network="false"/>
required
Allows to declare the supported modes.
Attribute
-
el:easy(required): If the level has a easy mode, the attribute is set on "true", otherwise on "false". -
el:single(required): If the level for single players is playable, the attribute is set on "true". If the level can be played only over a two-player network, it obtains the value "false". -
el:network(required): If the level is playable over a two-player network, the attribute is set on "true". If the level can be played only as single players, it obtains the value "false". -
el:control(optional): Indicates, with which input device and/or in which way the level is controlled. Default is "force". If the attribute is set on "balance", with the mouse the whole world is placed diagonally. If the level is to be controlled via the keyboard, which is particularly practical with Sokoban levels, the value is set on "key". The moreover one it gives for alternative input methods is the value "other". Which method at the conclusion is used effectively, the user decides. However high scores are stored only if they were reached with the input method defined here. In the current Enigma version levels can be played only with the method "force". The other input methods do not function yet. -
el:scoreunit(optional): It specifies whether the best performance is indicated as a time ("duration") or as number ("number"). The smaller the time or the number, so much the better the achievement. Default is "duration". -
el:scoretarget(optional): Indicates, how the best performance is measured. Default is "time", which measures the necessary time. "pushes" counts how much times a crate is pushed and is suitable therefore for Sokoban levels. "moves" counts the number of movements of the Actors. Alternatively you can also assign the name of a Lua function, which returns the score to the attribute.
Element contents
This element does not have contents.
el:comments
<el:comments> <el:credits el:showinfo="true" el:showstart="true"> Thanks to the Elves, who tested this level. </el:credits> <el:dedication el:showinfo="true" el:showstart="true"> For Rudolph with the red nose, which always shines the way for me. </el:dedication> <el:code> notes to the code, e.g. To-Do lists or version references </el:code> </el:comments>
optional
el:comments contains notes of the authors, thanks, dedications, greetings to your mother etc.
Attribute
This element does not have attributes
Element contents
see XML-Metadata/el:comments (German:XML-Metadaten/el:comments) for child-elements.
el:update
<el:update el:url="http://mein-server.org/pfad/zum/level.xml"/>
optional
This indicates the URL by which a new version of the level can be obtained after the revision number is increased. Note: Levels that are supplied together with Enigma, are hosted also by the Enigma team on the (not yet existing) Enigma Level server. Anybody who does not want that his level-updates go through the engima-team before being published needs to distribute his levels on his own.
Attribute
-
el:url(required): An URL, which is valid for a long time, under which level updates are published.
Element contents
This element does not have contents.
el:upgrade
<el:upgrade el:url="http://mein-server.org/pfad/zum/level_v2.xml" el:release="2"/>
optional
This indicates the URL by which a new version of the level can be obtained after the release number is increased.
Attribute
-
el:url(required): An URL, which is valid for a long time, under which level upgrades are published. -
el:release(required): The Release Number, the upgrades.
Element contents
This element does not have contents.
el:score
<el:score el:easy="00:23" el:difficult="00:55"/>
required
Indication on the best time. However these are the (best)times of the authors and not the absolute best time.
Attribute
-
el:easy(required): Best performance in easy mode. If the best performance is indicated in time, the attribute obtains a value in the formMM:SS, with two digits for the minutes and two for the seconds. If the best performance in amount of sreps or stone moves is measured, simply a number is registered here. If the level author is yet to solve the level in easy mode the value assigned to the attribute is "-". -
el:difficult(required): Similar to el:easy for the difficult mode.
Element contents
This element does not have contents.

