On Sat, Apr 26, 2008 at 3:50 AM, Reema wrote:

> Hi,
> I have a listbox in my XUL Overlay. I want to be able to read the
> name-value
> pairs from an XML file. I am able to parse the XML file and create a
> listitem element. The problem is, when I try to append this element using
> the appendChild method on the listbox, the element does not get added,
> although it does not return with an error.

I'd try separating the two parts of the code - everything up to adding the
list item and adding the list item.

> var item = document.createElementNS(XUL_NS, "listitem"); //
> create a new XUL listitem
> item.setAttribute("label", label[i].getAttribute("name"));
> item.setAttribute("value", label[i].getAttribute("color"));
> lb.appendChild(item);

You can use lb.appendItem() instead. Also check if this code ever runs and
the values of label[i].getAttribute("name") and color.