From: Ben N. <ben...@pc...> - 2003-01-27 21:19:21
|
Hi. I've just played around with webmin in the last hour or so, changing web-lib and index.cgi, to make webmin output valid xhtml... It seems that it'd be pretty easy to change some of the modules to output xml, and then run an xsl stylesheet over the top to convert the xml/xsl to html. (My website is an example of this: http://www.ripcord.co.nz/). Before I jump in over my head and start cutting and chopping - could I convert some modules to output sensible xml without forking the code? If I do my own little fork - What version should I fork? Can I convince you all to convert the entire codebase to outputting xml with serverside xslt processing? ;) WRT/ XSLT: XSL has advantages over other templating engines: [a] It is a w3c recommendation, uses lots of open standards. [b] On mozilla 1.2 / ie6 you can send xml and xsl to the browser separately and the browser will apply the stylesheet. And for me personally: [a] I've got some nice xsl stylesheets sitting here, to create collapsible trees, do xml-rpc via js, browser-side sortable tables, etc. Regards, Ben |
From: Ben N. <ben...@pc...> - 2003-01-28 00:28:35
|
Further to my earlier post - here's some regexps I've been using to make Webmin valid xhtml. I'm running these regexps on the source code without many breakages (only 3 or 4 per file). I'm not sure on the history of this - but I think making Webmin output valid xhtml would be a good thing. :) * attributes are enclosed in quotes * all tags are closed (eg br/ hr/ img/) Because, once webmin outputs valid xhtml, the entire thing can be parsed as an xml document, and it's easy to output xml intermixed with the xhtml. You can write an xsl that will ignore all the tr, td, hr and table tags, and just look for tags which are outputted when $config{'xml'} is true. I'll post a screenshot of why I'm so keen on webmin->xml (hopefully) later today. Regards, Ben Regular expression to fix 'wrong' attributes - misses some body tags: s # (href|cellpadding|cellspacing|width|colspan|height|border|alt|align|vali gn|alt)=([^ ,>\\]+) # \1=\"\2\" # Regular expression to fix unclosed tags - misses imgs s # <((hr|br)[^>/]*)> # <\1/> # |
From: Jamie C. <jca...@we...> - 2003-01-28 01:33:44
|
If the changes don't break anything, I'd be happy to include them in the main webmin distribution if you send me diff files.. An XHTML conversion would be better than changing all the CGIs to output XML, as it would be far less drastic. Maybe do a few files and show me what you've done so I can consider it and make some suggestions .. - Jamie Ben Nolan wrote: > Further to my earlier post - here's some regexps I've been using to make > Webmin valid xhtml. I'm running these regexps on the source code without > many breakages (only 3 or 4 per file). > > I'm not sure on the history of this - but I think making Webmin output > valid xhtml would be a good thing. :) > > * attributes are enclosed in quotes > * all tags are closed (eg br/ hr/ img/) > > Because, once webmin outputs valid xhtml, the entire thing can be parsed > as an xml document, and it's easy to output xml intermixed with the > xhtml. > > You can write an xsl that will ignore all the tr, td, hr and table tags, > and just look for tags which are outputted when $config{'xml'} is true. > > I'll post a screenshot of why I'm so keen on webmin->xml (hopefully) > later today. > > Regards, > Ben > > Regular expression to fix 'wrong' attributes - misses some body tags: > > s > # > (href|cellpadding|cellspacing|width|colspan|height|border|alt|align|vali > gn|alt)=([^ ,>\\]+) > # > \1=\"\2\" > # > > Regular expression to fix unclosed tags - misses imgs > > s > # > <((hr|br)[^>/]*)> > # > <\1/> > # |
From: Ben N. <ben...@pc...> - 2003-01-28 02:14:20
|
> If the changes don't break anything, I'd be happy to include them in > the main webmin distribution if you send me diff files.. An XHTML > conversion would be better than changing all the CGIs to output XML, > as it would be far less drastic. Maybe do a few files and show me what > you've done so I can consider it and make some suggestions .. I was joking re converting all of Webmin to xml. It would be nice and futureproof, but would be a somewhat intense project. :) I'll tidy-up the xhtml conversions I've done so far (web-lib and index) and post them through. My interest in Webmin is in creating an admin tool for some of my clients. As I said earlier, I've got a treasurechest of xsl, css and javascript files that create a really nice GUI - and I'd like to get Webmin to work with them. So if the Webmin source outputted valid xhtml - the number of diffs I'd have to maintain to get webmin to work with my libraries would be greatly reduced. Regards, Ben |