The text files that RealProducer uses when encoding streamsjob file, audience file, and server fileuse XML (eXtensible Markup Language) syntax. This appendix covers the basics of editing these files, explaining tags, lists, and namespaces. Subsequent appendixes cover the specific syntax for each file type in detail.
This section explains the basics of XML markup, introducing you to the rules you need to follow when editing an XML file. If you are familiar with other Web-based markup languages, such as HTML, you will pick up XML quickly. You need to be careful, though, because XML is less forgiving than HTML. Lapses that may not matter in HTML markup, such as missing quotation marks or end tags, will prevent an XML file from working properly.
Tip:
You can edit an XML file with any text, HTML, or XML
editor that can save the file as plain text with the proper
extension. On Windows, some text editors may automatically
include .txt as the extension. Disable this feature when saving
by choosing All Files for Save as type, or change the saved file's
.txt extension through the operating system.
|
XML files begin with an <?xml> version tag:
<?xml version="1.0" encoding="UTF-8"?> |
Following the version tag, markup consists of one or more elements. An
audience file, for example, uses an <audience> element that contains all
additional markup:
<?xml version="1.0" encoding="UTF-8"?> |
Each xmlns attribute shown above defines an XML namespace. This namespace
tells RealProducer how to handle the markup contained within the file. The
namespace identifier is in the form of a URL only to ensure uniqueness.
RealProducer does not contact the URL.
| Note: If you edit an XML file, do not change the namespaces. When creating a new XML file, be sure to use the appropriate namespaces for the file type. |
Elements within an XML file take the following form:
< |
The following are the basic parts to an XML element:
tag |
The tag name comes just after a left angle bracket. Some tags may consist of just the name, as in the <stream> tag. Other tags may have attributes. Except for the XML version tag and the comment tag, all tags in an XML file have a corresponding end tag. For example, the <audience> tag has the end tag </audience>. |
type |
The type attributes defines the type of data that the element provides. For more information, see "Data Type Values". |
value |
The value is a character string, integer, time value, or so on that defines the feature. |
In RealProducer markup, single-word tags and attributes are lowercase. When
a tag, attribute, or predefined value consists of a compound word, the first
letter of all words after the first word is generally capitalized, as in
encodingComplexity. This is referred to as "camel case."
Attribute values, such as string in type="string", must be enclosed in double
quotation marks. Do not add any blank spaces between the quotation marks
and the value they enclose.
Most XML elements within the RealProducer files must include a type
attribute that indicates the type of value.
The following examples illustrate the use of the type attribute in RealProducer XML files:
<outputWidth type="uint">360</outputWidth> |
<maxFrameRate type="double">15.000000</maxFrameRate> |
<streamContext type="bag"> |
<stream xsi:type="audioStream"> |
<deinterlace type="bool">true</deinterlace> |
<pluginName type="string">rn-prefilter-deinterlace</pluginName> |
The format for the value of a parameter that specifies a duration is the following:
[d:][h:][m:]s[.xyz] |
Only the seconds value is required. If a value is omitted, it is assumed to be zero. You must specify intermediate values. To indicate hours, for example, you must include the minutes and seconds field. Here are some sample values:
30 |
30 seconds |
45.5 |
45-1/2 seconds |
5:35 |
5 minutes, 35 seconds |
1:0:0 |
1 hour |
1:22:30:0 |
1 day, 22 hours, 30 minutes |
In tags that specify files or other input, paths and file names can be uppercase, lowercase, or mixed case, corresponding to their actual names on the operating system. All of the following path and file name examples are allowable, for example:
<filename type="string">C:\media\video\video1.rm</filename> |
| Note: On operating systems that are not case-sensitive, such as Windows, these tags all specify the same file. On a case- sensitive operating system such as Linux, these tags indicate different files. |
Although not strict rules, the following recommendations will help you keep your XML markup organized and understandable.
As in HTML, XML has a comment tag that starts with these characters:
<!-- |
and ends with these characters:
--> |
There is no corresponding end tag:
<!-- This is a comment --> |
A comment can be any number of lines long. It can start and end anywhere in a XML file. Multiple comments cannot be nested, though. Use comments to describe what various sections of your XML file are meant to do. This helps other people understand your file more easily.
Although indenting XML markup is not required, it helps you to keep track of
the XML file's structure. You typically indent markup by pressing the Tab key
once for each level of indentation. In a stream section, for example, the
element tags are indented one level from the <stream> tag. The two tags that
make up the stream context are indented one level from the <streamContext>
tag:
<stream xsi:type="audioStream"> |
|
|
©2004 RealNetworks, Inc.
For more information, visit RealNetworks Click here if the Table of Contents frame is not visible at the left side of your screen. |