Author:Jared Jurkiewicz

OpmlStore is a simple read-only store provided by Dojo and contained in the DojoX project. OpmlStore is a read interface to work with Opml formatted XML files. Similar to ItemFileReadStore, OpmlStore reads the contents from an http endpoint or a browser DOM object that contains Opml formatted data.

The following APIs are implemented by OpmlStore

The following example shows an Opml data source:

<?xml version="1.0" encoding="ISO-8859-1"?>
<opml version="1.0">
    <ownerName>Magellan, Ferdinand</ownerName>
    <outline text="Africa" type="continent">
      <outline text="Egypt" type="country"/>
      <outline text="Kenya" type="country">
        <outline text="Nairobi" type="city"/>
        <outline text="Mombasa" type="city"/>
      <outline text="Sudan" type="country">
        <outline text="Khartoum" type="city"/>
    <outline text="Asia" type="continent">
      <outline text="China" type="country"/>
      <outline text="India" type="country"/>
      <outline text="Russia" type="country"/>
      <outline text="Mongolia" type="country"/>
    <outline text="Australia" type="continent" population="21 million">
      <outline text="Australia" type="country" population="21 million"/>
    <outline text="Europe" type="continent">
      <outline text="Germany" type="country"/>
      <outline text="France" type="country"/>
      <outline text="Spain" type="country"/>
      <outline text="Italy" type="country"/>
    <outline text="North America" type="continent">
      <outline text="Mexico" type="country" population="108 million" area="1,972,550 sq km">
        <outline text="Mexico City" type="city" population="19 million" timezone="-6 UTC"/>
    <outline text="Guadalajara" type="city" population="4 million" timezone="-6 UTC"/>
      <outline text="Canada" type="country" population="33 million" area="9,984,670 sq km">
        <outline text="Ottawa" type="city" population="0.9 million" timezone="-5 UTC"/>
        <outline text="Toronto" type="city" population="2.5 million" timezone="-5 UTC"/>
      <outline text="United States of America" type="country"/>
    <outline text="South America" type="continent">
      <outline text="Brazil" type="country" population="186 million"/>
      <outline text="Argentina" type="country" population="40 million"/>

Each data item is one of the <outline> tags. Each attribute on the outline acts as a attribute of the data item. For children tags, they are accessed via a special 'children' attribute. So, as expected by, everything can be easily accessed via csvStore.getValue's'(), which makes it pluggable into aware widgets.

Constructor Params

Parameter Required Description Since
url No This optional parameter specifies what URL from which to load the Opmldata Note that this URL is only loaded one time, as this is an in-memory data store. 1.0
data No A DOM of OPML data to use to populate the store. This parameter can be used instead of url. when you wish to load data differently then modify it to fit the expected Opml format. 1.0
label No A string that identifies which attribute to treat as the human-readable label. It must match one of the attributes on the <outline> tags for it to be effective. 1.0
urlPreventCache No Flag denoting whether or not browser caching should be avoided. Defaults to false. 1.4

Query Syntax

The query syntax used by is identical to the query syntax used by

Query Options defines support for a 'queryOptions' modifier object that affects the behavior of the query. The two defined options listed by the API are ignoreCase and deep. OpmlStore supports these options. The affect of these options on a query is defined below.

Option Result
ignoreCase The default is false. When set to true, the match on attributes is done in a case-insensitive fashion. This means with ignoreCase: true, a query of A* would match Apple and acorn
deep Default is false. By default, only root outline tags are matched. By setting to true, children tags are also scanned


Connecting OpmlStore to dijit.form.ComboBox

Note that dijit.form.ComboBox automatically passes the queryOption deep:true. This is because for ComboBox, hierarchy does not make sense, so searching as a flat list is preferable

<div data-dojo-type="" data-dojo-props="url:'{{dataUrl}}dojox/data/tests/stores/geography.xml'" data-dojo-id="geoStore"></div>
<div data-dojo-type="dijit.form.ComboBox" data-dojo-props="store:geoStore, searchAttr:'text'"></div>

Connecting OpmlStore to dijit.Tree

Since Opml data can be hierarchical, the Tree widget is an excellent demo for it. A similar demo can be seen with ItemFileReadStore. here

<div data-dojo-type="" data-dojo-props="url:'{{dataUrl}}dojox/data/tests/stores/geography.xml', label:'text'" data-dojo-id="geoStore2"></div>
<div data-dojo-type="dijit.tree.ForestStoreModel" data-dojo-id="geoModel" data-dojo-props="store:geoStore2, query:{}, rootId:'Geography', rootLabel:'Geography'"></div>
<div data-dojo-type="dijit.Tree" data-dojo-props="model:geoModel"></div>

Connecting OpmlStore to dojox.grid.DataGrid

Note here that as part of the DataGrid definition, the queryOption deep is set true. For the DataGrid, hierarchy here does not make sense


var layoutGeo = [
    { field: "text", name: "Name", width: 10 },
    { field: "type", name: "Geography Type", width: 10 },
    { field: "population", name: "Population", width: 'auto' }
<div data-dojo-type="" data-dojo-props="url:'{{dataUrl}}dojox/data/tests/stores/geography.xml', label:'text'" data-dojo-id="geoStore3"></div>

<div style="width: 400px; height: 300px;">
  <div id="grid"
@import "{{baseUrl}}dojox/grid/resources/Grid.css";
@import "{{baseUrl}}dojox/grid/resources/nihiloGrid.css";

.dojoxGrid table {
  margin: 0;
Error in the documentation? Can’t find what you are looking for? Let us know!