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/> # |