Auto update data file format

Your screensaver learns about the updates by downloading an XML file containing the update information from your website. For auto updates to work, you need to create a valid XML file with the update info. This article describes the format of an auto update XML file and provides a sample code.

Understanding XML and HTML

XML file is a simple text file that contains textual data written in XML format, so you will have to understand XML and HTML programming basics. Unfortunately this is beyond the scope of this article and you will have to learn this on your own. You may also learn by observing the sample file given below.

Learning the XML file structure

  • XML contains root element <items>..</items>
  • Root element contains <item>..</item> subnodes
  • Each <item> subnode contains following subnodes
    • <command>..</command> - required
    • <url>..</url> - required
    • <caption>..</caption> - optional
    • <imagesize>..</imagesize> - optional

Sample update XML file explained

Observe the following auto update XML file sample contents.

<items>
  <item>
    <command>add</command>
    <url>http://www.yourweb.com/updates/newimage1.jpg</url>
    <caption labelposition="top-right" fontcolor="#CC33CC" labelx="10" labely="20" shadow="no" fontname="arial" italic="yes" fontsize="40">New Title</caption>
    <imagesize position="random">stretch</imagesize>
  </item>
  <item>
    <command>add</command>
    <url>http://www.yourweb.com/updates/newimage2.jpg</url>
  </item>
  <item>
    <command>delete</command>
    <url>http://www.yourweb.com/updates/oldimage1.jpg</url>
  </item>
</items>

This file updates a screensaver in the following way:

  • Adds picture from
    http://www.yourweb.com/updates/newimage1.jpg
  • Adds picture from
    http://www.yourweb.com/updates/newimage2.jpg
  • Removes picture added in an older update from
    http://www.yourweb.com/updates/oldimage1.jpg
  • Sets label for newimage1.jpg:
    • Label text to New Title
    • Label position to Top Right (labelposition="top-right")
    • Label color to #CC33CC (fontcolor="#CC33CC"), the color is given in HTML format
    • Horizontal label spacing to 10 (labelx="10")
    • Vertical label spacing to 20 (labelx="20")
    • Shadow to off (shadow="no")
    • Font name to Arial (fontname="arial")
    • Makes font italic (italic="yes")
    • Font size is set to 40 (fontsize="40")
  • Sets positioning newimage1.jpg:
    • Sets sizing to Stretch
    • Sets image position to Random (position="random")

XML subnode specification

This chapter describes subnodes, their properties and possible values that can be used inside of each <item> subnode.

<command> subnode

Values:

  • add - item is added
  • delete - item is deleted

Example:

<command>add</command>

<url> subnode

Value is a valid web address (URL)

Example:

<url>http://www.yourweb.com/newimage.jpg</url>

<caption> subnode

Value is the text for the label

Properties:

Property Possible values Example
labelposition top-left, top-right, top-center, bottom-left, bottom-right, bottom-center, center labelposition="top-left"
fontcolor color in an HTML format fontcolor="#FFFFFF"
fontbg color in an HTML format fontbg="#000000"
fontname font name fontname="arial"
fontsize number - font size fontsize="40"
labelx number - label x spacing labelx="10"
labely number - label y spacing labely="20"
shadow yes, no shadow="no"
transparent yes, no transparent="yes"
antialiased yes, no antialiased="yes"
italic yes, no italic="yes"
bold yes, no bold="no"

Example:

<caption labelposition="top-right" fontname="arial">Some Title</caption>

<imagesize> subnode

Values:

  • fit - fit to screen
  • stretch - stretch
  • fitbig - fit to screen only if too big
  • fill - fill screen
  • none - do not change size

Properties:

Property Possible values Example
position random, center position="random"

Example:

<imagesize position="random">none</imagesize>