I finally conned convinced a client into using XUL for part
of their application. Part of my design involved using some links to the regular non-XUL app. Luckily,
the XUL Tutorial has a section on
Adding HTML Elements.
I looked that up, and got my links set up:
<?xml version="1.0" encoding="utf-8" ?>
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<html:a href="/default.asp">Home</html:a>
<html:a href="/reports/reportTree.aspx">Reports</html:a>
</window>
That doesn't work though. The raw literals "Home" and "Reports" don't get rendered, because XUL doesn't know what to do with raw text.
I tried wrapping the text in
<label>s, but clicking the label didn't work. The solution was to wrap the
<html:a> in another HTML element, in my case a list:
<?xml version="1.0" encoding="utf-8" ?>
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<html:ul>
<html:li>
<html:a href="/default.asp">Home</html:a>
</html:li>
<html:li>
<html:a href="/reports/reportTree.aspx">Reports</html:a>
</html:li>
</html:ul>
</window>
It doesn't make much sense to me that you need to wrap the link in another HTML element for the link's text to show properly. Is that a parsing bug?
For those that noticed the link hrefs: yes, this application is so old that it uses VBScript ASP, C# ASP.NET, and now JS XUL.