MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 87562 of Microsummary XML grammar reference

  • Revision slug: Microsummary_XML_grammar_reference
  • Revision title: Microsummary XML grammar reference
  • Revision id: 87562
  • Created:
  • Creator: MykMelez
  • Is current revision? No
  • Comment explain the purpose of the uri attribute to the generator tag
Tags: 

Revision Content

{{template.Draft()}}

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 (required)
A descriptive, human-readable name for the microsummary created by the generator.
uri (optional)
A valid URI uniquely identifying the generator. Only relevant for generators dynamically created by Firefox code and extensions. Generators installed from the web via nsSidebar::addMicrosummaryGenerator are identified by the remote URL from which they were downloaded, and Firefox ignores the value of this attribute for them.

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 minutes, that should elapse between looking for an updated version of the generator. The interval must be at least 1 minute. The interval can include a fractional part (such as 5.5 minutes), although that's not necessarily useful.

Microsummaries are checked to see if it's time to refresh them every 15 seconds, so it's possible that the refresh may take place as much as 15 seconds later than the specified interval.

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.

The <template> element

The <template> element is used to wrap a set of XSLT transform sheets that do the job of translating the document contents into the format to be displayed in the microsummary. It has the following attributes:

match
Defines the node of the document to which the transform should be applied.

The <template> tag should contain the XSLT transform.

See also

Revision Source

<p>{{template.Draft()}}
</p><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> (required)
</dt><dd> A descriptive, human-readable name for the microsummary created by the generator.
</dd><dt> <code>uri</code> (optional)
</dt><dd> A valid URI uniquely identifying the generator.  Only relevant for generators dynamically created by Firefox code and extensions.  Generators installed from the web via <code>nsSidebar::addMicrosummaryGenerator</code> are identified by the remote URL from which they were downloaded, and Firefox ignores the value of this attribute for them.
</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 minutes, that should elapse between looking for an updated version of the generator.  The interval must be at least 1 minute.  The interval can include a fractional part (such as 5.5 minutes), although that's not necessarily useful.
</dd></dl>
<p>Microsummaries are checked to see if it's time to refresh them every 15 seconds, so it's possible that the refresh may take place as much as 15 seconds later than the specified interval.
</p>
<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>
<h2 name="The_.3Ctemplate.3E_element">The <code>&lt;template&gt;</code> element</h2>
<p>The <code>&lt;template&gt;</code> element is used to wrap a set of XSLT transform sheets that do the job of translating the document contents into the format to be displayed in the microsummary.  It has the following attributes:
</p>
<dl><dt> <code>match</code>
</dt><dd> Defines the node of the document to which the transform should be applied.
</dd></dl>
<p>The <code>&lt;template&gt;</code> tag should contain the <a href="en/XSLT">XSLT</a> transform.
</p>
<h2 name="See_also">See also</h2>
<ul><li> <a href="en/Creating_a_Microsummary">Creating a Microsummary</a>
</li><li> <a href="en/XSLT">XSLT</a>
</li></ul>
Revert to this revision