Microsummary XML grammar reference

  • Revision slug: Microsummary_XML_grammar_reference
  • Revision title: Microsummary XML grammar reference
  • Revision id: 87556
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment checkpoint save

Revision Content

A microsummary generator is an XML document that describes how to pull specific information from a web page to be presented in summary form as a bookmark whose title changes based on the content of the page it targets.

This article provides detailed information about the XML grammar used to build microsummary generators, describing each element and their attributes. For an introduction to how to create a microsummary, read the article Creating a Microsummary.

The <generator> element

The <generator> element is the root tag for all microsummary generators, and should contain the remainder of the XML code describing the generator.

It has the following attributes:

name
A descriptive, human-readable name for the microsummary created by the generator.
uri
Local generators -- those with a local URI -- should provide the uri attribute. Why? What's it used for?

The <pages> element

The <pages> element brackets a list of web page URIs that define pages that should and should not be summarized by the generator. This is done by using <include> and <exclude> elements, contained within the <pages> block.

<include> and <exclude> are defined as follows:

 <include>uri</include>
 <exclude>uri</exclude>

The uri may be specified using regular expressions, if you wish. See the article Creating regular expressions for a microsummary generator for an explanation of how to use regular expressions in microsummary generators.

You may include as many <include> and <exclude> elements as you wish in the <pages> section.

The <update> element

The <update> element lets the generator specify values describing how often Firefox should check to see if there's a newer version of the generator, as well as where to look for the update. The following attributes are available:

interval
The time interval, in seconds, that should elapse between looking for an updated version of the generator. Due to rounding, it's unlikely that the update check will occur on precisely the interval you specify.

Conditional update intervals

If you wish to provide conditions under which the update interval can vary, you can do so by placing <condition> tags inside the <interval> section. These have the following syntax:

 <condition> expression="expr" interval="interval"</condition<&gt>
expression
An XPath Boolean expression to evaluate. If it evaluates to true, the given interval is applied.
interval
The interval to apply if expr evaluates to true.

Revision Source

<p>A microsummary generator is an XML document that describes how to pull specific information from a web page to be presented in summary form as a bookmark whose title changes based on the content of the page it targets.
</p><p>This article provides detailed information about the XML grammar used to build microsummary generators, describing each element and their attributes.  For an introduction to how to create a microsummary, read the article <a href="en/Creating_a_Microsummary">Creating a Microsummary</a>.
</p>
<h2 name="The_.3Cgenerator.3E_element">The <code>&lt;generator&gt;</code> element</h2>
<p>The <code>&lt;generator&gt;</code> element is the root tag for all microsummary generators, and should contain the remainder of the XML code describing the generator.
</p><p>It has the following attributes:
</p>
<dl><dt> <code>name</code>
</dt><dd> A descriptive, human-readable name for the microsummary created by the generator.
</dd><dt> <code>uri</code>
</dt><dd> Local generators -- those with a local URI -- should provide the <code>uri</code> attribute.  <i>Why?  What's it used for?</i>
</dd></dl>
<h2 name="The_.3Cpages.3E_element">The <code>&lt;pages&gt;</code> element</h2>
<p>The <code>&lt;pages&gt;</code> element brackets a list of web page URIs that define pages that should and should not be summarized by the generator.  This is done by using <code>&lt;include&gt;</code> and <code>&lt;exclude&gt;</code> elements, contained within the <code>&lt;pages&gt;</code> block.
</p><p><code>&lt;include&gt;</code> and <code>&lt;exclude&gt;</code> are defined as follows:
</p>
<pre class="eval"> &lt;include&gt;<i>uri</i>&lt;/include&gt;
 &lt;exclude&gt;<i>uri</i>&lt;/exclude&gt;
</pre>
<p>The <i>uri</i> may be specified using regular expressions, if you wish.  See the article <a href="en/Creating_regular_expressions_for_a_microsummary_generator">Creating regular expressions for a microsummary generator</a> for an explanation of how to use regular expressions in microsummary generators.
</p><p>You may include as many <code>&lt;include&gt;</code> and <code>&lt;exclude&gt;</code> elements as you wish in the <code>&lt;pages&gt;</code> section.
</p>
<h2 name="The_.3Cupdate.3E_element">The <code>&lt;update&gt;</code> element</h2>
<p>The <code>&lt;update&gt;</code> element lets the generator specify values describing how often Firefox should check to see if there's a newer version of the generator, as well as where to look for the update.  The following attributes are available:
</p>
<dl><dt> <code>interval</code>
</dt><dd> The time interval, in seconds, that should elapse between looking for an updated version of the generator.  Due to rounding, it's unlikely that the update check will occur on precisely the interval you specify.
</dd></dl>
<h3 name="Conditional_update_intervals">Conditional update intervals</h3>
<p>If you wish to provide conditions under which the update interval can vary, you can do so by placing <code>&lt;condition&gt;</code> tags inside the <code>&lt;interval&gt;</code> section.  These have the following syntax:
</p>
<pre class="eval"> &lt;condition&gt; expression="<i>expr</i>" interval="<i>interval</i>"&lt;/condition&lt;&amp;gt&gt;
</pre>
<dl><dt> <code>expression</code>
</dt><dd> An XPath Boolean expression to evaluate.  If it evaluates to <code>true</code>, the given <code>interval</code> is applied.
</dd><dt> <code>interval</code>
</dt><dd> The interval to apply if <i>expr</i> evaluates to <code>true</code>.
</dd></dl>
Revert to this revision