Posted on 2007-11-29 06:03:31-08 by roiji
XUL HTML elements not displaying...
Hi,

I was trying to display html elements such as links(anchors) or h1's in XUL using this template declare and it does not display...

I have already put 'HTML' and 'XUL' in the "use Template::Declare::Tags" and also put the html namespace in the window tag
here's my code:
#!/usr/bin/perl print "Content-type: application/vnd.mozilla.xul+xml \n\n"; package MyApp::Templates; use base 'Template::Declare'; use Template::Declare::Tags 'HTML', 'XUL'; print "<?xml version='1.0'?>\n"; print "<?xml-stylesheet href='../style.css' type='text/css'?>\n"; print " <window xmlns:html='http://www.w3.org/1999/xhtml' xmlns='http://www.mozilla.org/keymaster/g +atekeeper/there.is.only.xul'>"; template main => sub { html:a { attr {href => 'here.html'} "click there"}; }; package main; Template::Declare->init( roots => ['MyApp::Templates']); print Template::Declare->show('main'); print "\n</window>\n";
But when I view the source of the document it displays well..
<?xml version='1.0'?> <?xml-stylesheet href='../style.css' type='text/css'?> <window xmlns:html='http://www.w3.org/1999/xhtml' xmlns='http://www.mozilla.org/keymaster/gatekeep +er/there.is.only.xul'> <a href="here.html">click there</a> </window>
Am I missing out on something or it just doesn't support it... or something?
thanks!
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.