I have a XHTML document and want to embed XUL widgets into the document. What is the correct XML syntax to do so?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
insert XUL here
</body>
</html>
An XHTML document must have an XHTML <!DOCTYPE> declaration. The <html>, <head>, <title>, and <body> elements must also be present, and the xmlns attribute in <html> must specify the xml namespace for the document.
<html> is the root element of XHTML MP. All other elements should be enclosed within the <html></html> tags. The xmlns attribute is used to define the namespace for XHTML MP.
add xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
to your <html>
tag.
then use <xul:element>
, e.g. <xul:vbox>
Edit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<xul:vbox>
</xul:vbox>
</body>
</html>
Also, I assume this isn't such a simple case... otherwise there wouldn't be much point in wrapping the xul in html (though the other way around does happen sometimes)
Edit
Some additional points to keep in mind when doing this:
(thanks to Nikolay for the first point)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With