How do I add a datasource to a XUL template?
Although it’s possible to create a XUL template with an “implicit” set of datasources by specifying the datasources attribute, there are often times when you won’t know the datasource that you want to add until after the XUL is loaded. For example, your XUL may need compute the datasources that it wants to display in an onload handler. Or, it may need to add a datasource later based on some user action. Here’s a simple example that illustrates how to do this. Let’s start with the following XUL.