Personal tools

XML

From Stinova Wiki

Revision as of 13:43, 2 April 2012 by Chris (Talk | contribs)
Jump to: navigation, search

XML Time

Displaying TIME and DATE doesn’t directly work by writing the syntax inside the Composer.

If you want to display Time, you have to simply write “TIME” inside your text field (“DATE” for date) and format it to your liking. Now you have to click into “Object Link” (top right corner) and insert the Syntax which specifies how the time/date is displayed.


For example:

              #{TIME,HH:MM:SS}          -   14:38:22
              #{DATE,DD-MM-YYYY}        -   01-January-2012
              #{DATE,DD-mm-YYYY}        -   01-01-2012


XML Time and Date.jpg


You can insert any symbol between “HH-MM-SS” as long as you keep the standard formatting of “#{DATE,….HH…MM…SS}”. If you only want to Display Hours and Minutes just leave out SS for seconds and time is displayed with just Hours and Minutes.

You can see your result immediately if you click on preview (bottom right corner).

Please note that Syntax will use the local time of the playout device.


XML Parsing

XML file example

<xml>
<ttl>5</ttl>
<arrivals>
 <flight>
   <number>135</number>
   <from>Paris</from>
   <eta>13:44:55</eta>
   <notes>5 min delay</notes>
 </flight>
 <flight>
   <number>231</number>
   <from>New York</from>
   <eta>13:47:10</eta>
   <notes></notes>
 </flight>
</arrival>
</xml>

Addressing is done in the following way:

#{URL;@XMLPath}

Create a text block in your Composer, and insert the address that links to the XML file.

#{http://server.com/flight.xml;@xml/arrivals/flight/number}
#{http://server.com/flight.xml;@xml/arrivals/flight/from}

This line will read the first flight number from the XML document.

To address second the flight number, use [$index], where index starts from 0.

So the second element will be:

#{http://server.com/flight.xml;@xml/arrivals/flight[1]/number}

Note:

* It is possible to put more then one tag in the text block.
* It is possible to mix tags and text in one text block.

Update

XML files are refreshed every 2 minutes, or from rss/channel/ttl or $anyroot$/ttl parameter.

ttl values are always in minutes.