Re: css as xml?

On Mon, 17 Feb 2003 18:48:09 -0500, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:

>> It seems that everything will be XML in the future.
>
> I hope you're wrong about this -- XML is not nearly as easy to read for a 
> human as CSS is (largely because it is a lot more verbose; this verbosity 
> has other disadvantages too).

Yes, I agree. In the early enthusiastic days of XML it was common to state 
that *everything* will become XML, you will need no other syntax. Many 
might still believe that, but I think we are passing from the 
"overextending the new technology to see where it fits" phase to the "use 
it when useful" phase. XML is wonderful for some purposes, such as document 
markup, and terrible for other purposes, such as programming languages.

For instance XSLT was made with the explicit goal that the syntax must be 
XML, whether or not that was appropriate. In my view XSLT suffers from that 
decision, though the language is much more suited for XML than what for 
instance JavaScript would have been.


It is easy to transform the CSS syntax into XML. It would be just as easy 
to transform it into the mail header format, "fieldname: fieldvalue; 
parameters", as used in RFC561 [1] and onwards. This format is more 
ubiquitous than XML, even if it is mostly used in transport protocols. 
vCard is one example of a data format using this syntax, and here is an 
example of what "cCard" might have looked like:

begin: css; charset=utf-8
(this is a comment; the rule above would be '@charset "utf-8";' in CSS)

begin: rule
selector: body; language=en
(this is the CSS selector 'body:lang(en)') background-color: #EFEFEF
font-family : Trebuchet MS, Trebuchet, Verdana, Arial, Helvetica, sans- 
serif
color: #000000
margin: 75px 50px 0 0
padding: 0px
text-align: justify
end: rule
end: css


If you think in programming languages, you could use a JavaScript syntax 
for CSS. For an exercise in that, look up 'JSSS'.


[1] Standardizing Network Mail Headers, 1973
<http://www.zvon.org/tmRFC/RFC561/Output/>
I think this is the first RFC to use the mail header syntax. I adore the 
sentence "Although the long-term solution to the problem is probably to 
[extend proto-Telnet], we hereby propose a more quickly implemented 
solution for the interim.". Parametres and the '@' symbol came later.

-- 
Jonny Axelsson,
Web standards,
Opera Software

Received on Tuesday, 18 February 2003 04:36:35 UTC