tag:blogger.com,1999:blog-3159448148532564697.post5256379611464735263..comments2020-12-09T05:41:34.498-08:00Comments on barefootliam: CSS Within XSLT - a way to simplify simple HTML generation from XSLTLiam Quinhttp://www.blogger.com/profile/07191558941418599733noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-3159448148532564697.post-62326176459505060222020-12-09T05:41:34.498-08:002020-12-09T05:41:34.498-08:00@Norm yes, i generate the entire CSS - there's...@Norm yes, i generate the entire CSS - there's a css:media element that can contain rules (it has a when attribute) and can go anywhere.<br /><br />@Ari sorry :) i should have published sooner!Liam Quinhttps://www.blogger.com/profile/07191558941418599733noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-7696377972540773282020-12-09T03:46:39.585-08:002020-12-09T03:46:39.585-08:00This is a very cool idea. Where were you six month...This is a very cool idea. Where were you six months ago when I was cursing at multiple CSS files lagging behind after updating my XSLTs?Ari Nhttps://www.blogger.com/profile/09744727369919864899noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-88377521250122208812020-12-09T02:21:54.666-08:002020-12-09T02:21:54.666-08:00It's an interesting idea. Do you attempt to ge...It's an interesting idea. Do you attempt to generate the whole CSS stylesheet this way, including sections in media queries, or just the "core" bits.Norman Walshhttps://www.blogger.com/profile/10870115875719339520noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-37101458966895428072020-12-08T14:00:58.500-08:002020-12-08T14:00:58.500-08:00Yes, what i have works fine without a Java extensi...Yes, what i have works fine without a Java extension. There are two XSLT runs, but both done from a single styleseet, using fn:transform() to run the 2nd from the first. (i'm using xslt 3 - for xslt 1 i'd use two separate stylesheets, one that writes the css and writes out a temp file that's the XSLT without the CSS elements, and then the original transform.Liam Quinhttps://www.blogger.com/profile/07191558941418599733noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-14725556626179992952020-12-08T06:44:24.284-08:002020-12-08T06:44:24.284-08:00My goal was no java extension Liam?
Can include fr...My goal was no java extension Liam?<br />Can include from both html and CSS I believe?<br />Options seem to be two XSLT runs or a java extension?<br /> I guess for a server based transform java would win,<br />for a static site (I do like the 'closely associated' CSS)<br />I'd suggest two pass situation?Unknownhttps://www.blogger.com/profile/15776391827458687437noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-79450128357943867192020-12-08T05:45:56.839-08:002020-12-08T05:45:56.839-08:00Yes, XSLT can output multiple streams. But i need ...Yes, XSLT can output multiple streams. But i need all of the CSS in the result, not only the CSS that is in templates that were actually visited - for example because i might have media queries, global styles, or styles for content generated dynamically through JavaScript.<br /><br />It would be possible for my Java extension to write out the CSS,but i wanted a solution that worked with or without the extension.<br /><br />Note, although it's two separate steps, it's a single run of XSLT.<br /><br />Thanks for commenting!<br />Liam Quinhttps://www.blogger.com/profile/07191558941418599733noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-35310836479247861032020-12-08T03:06:44.587-08:002020-12-08T03:06:44.587-08:00It can, these days.It can, these days.yamahitohttps://www.blogger.com/profile/07434946766879145635noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-15766556608680795332020-12-08T02:33:04.755-08:002020-12-08T02:33:04.755-08:00Understood. Pity XSLT can't output two streams...Understood. Pity XSLT can't output two streams?Unknownhttps://www.blogger.com/profile/15776391827458687437noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-38015435878487188352020-12-08T02:21:23.693-08:002020-12-08T02:21:23.693-08:00Generating in a second pass is what he's doing...Generating in a second pass is what he's doing. He's not outputting it because he doesn't want css:* junk in his HTML.yamahitohttps://www.blogger.com/profile/07434946766879145635noreply@blogger.comtag:blogger.com,1999:blog-3159448148532564697.post-8672032699619566822020-12-08T00:34:09.066-08:002020-12-08T00:34:09.066-08:00Sounds rather complex?
Why not output it then gene...Sounds rather complex?<br />Why not output it then generate your cSS file in a second pass?Unknownhttps://www.blogger.com/profile/15776391827458687437noreply@blogger.com