Re: [Xsltforms-support] CSS not applied when using XSLTForms
Brought to you by:
alain-couthures
From: Conal T. <con...@ve...> - 2012-07-28 04:24:37
|
On 28/07/12 01:18, C. M. Sperberg-McQueen wrote: > On Jul 26, 2012, at 9:19 PM, Conal Tuohy wrote: > >> It's convenient, if you have to author CSS documents in a well-formed XML file, to be able to retain CSS validity. > My thoughts exactly. > >> In order to hide CSS from HTML 3 user agents, the CSS grammar allows SGML comment delimiters, which it ignores. So with a bit of finagling you can write polyglot xml/css using just a tricky prolog and epilog, e.g. >> >> <!--/*--><css><![CDATA[*/ >> >> /* Plain old css goes in here, & and < are all good */ >> >> h1 { >> color: green; >> } >> >> /*]]></css><!--*/--> > That is one of the most ingenious, twisted, sick and brilliant hacks I've > seen in a while. Thank you for that! Thanks Michael! :-) Here's a slightly improved version where an XML parser which evaluates the text content of the css element will also get valid CSS (the previous version had unmatched CSS comment markers): <!--/*--><css><![CDATA[/**/ /* Plain old css goes in here, & and < are all good */ h1 { color: green; } /*]]>*/<!--/*--></css><!--*/--> -- Conal Tuohy eResearch Business Analyst Victorian eResearch Strategic Initiative +61-466324297 |