W3C home > Mailing lists > Public > www-style@w3.org > December 2005

Re: styling xml with css - copying xml attribute values into CSS attribute values

From: Laurens Holst <lholst@students.cs.uu.nl>
Date: Sun, 11 Dec 2005 19:12:15 +0100
Message-ID: <439C6BFF.6030606@students.cs.uu.nl>
To: Noah Scales <noahjscales@yahoo.com>
Cc: www-style@w3.org

Noah Scales schreef:
> To create xml mark-up intended specifically to describe what I want to 
> display,
> I would like to be able to do the following:
>
> xml_element[xml_attribute]    {css_attribute:xml_attribute_value;}

You are looking for the CSS3 attr() function from the CSS3 Values and 
Units working draft:
http://www.w3.org/TR/2005/WD-css3-values-20050726/#attribute

It lets you create rules like this:

my-webpage-header[height] { height: attr(height,px); }

> To get a value from xml into a CSS attribute-value pair, you have to 
> add lots of rows to your CSS file.  If there were a way, within CSS, 
> to specify that an xml value belonging to an attribute of some xml 
> element should be the value of a CSS attribute, that would be great.  
> Let CSS get a url value from an xml attribute's value, and create 
> links that way,  instead of in XHTML. This would let me create 
> complete web-pages using a custom tag set that's particular to the 
> type of web-page that I'm building.

I do not think that’s a good idea, such a website poses 0 value from a 
semantic point of view.

> From my limited expressions of the semantics of my writing, the 
> scripting of what I'm designing for a web browser is best described 
> with a custom tag-set, whether I'm designing knowledge or a graphical 
> display. Using classes with xhtml is a choice to mark-up a graphical 
> display that I design, but it's no fun.
>
> <a href="./webpage.htm" class="breadcrumb">webpage</a>
>
> seems less expressive than
>
> <breadcrumb myurl="./webpage.htm">webpage</breadcrumb>

In the contrary, the latter is much much less expressive. Only because I 
know English, I understand what it means. Computers and people that do 
not understand English have no clue whatsoever. That’s why there are 
standards, which say ‘a’ designates a hyperlink, its ‘href’ attribute 
contains the link’s target. <breadcrumb> in this case is just as 
meaningless as class="breadcrumb", and compared to the first you loose 
all semantics by even (seemingly without reason) changing the attribute 
for the target.

Also, the nice thing about classes (or roles) is that you can state 
subclasses: ‘this is a hyperlink of type breadcrumb’, while your example 
just says ‘this is a breadcrumb’.

So, I think what you want to do is a bad idea. The pages that you create 
that way will not be accessible, not be machine-readable, and will be a 
bother to read and edit for people outside an UA because for every case 
they have to familiarise themselves with a new XML language.


~Grauw

-- 
Ushiko-san! Kimi wa doushite, Ushiko-san!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laurens Holst, student, university of Utrecht, the Netherlands.
Website: www.grauw.nl. Backbase employee; www.backbase.com.
Received on Sunday, 11 December 2005 18:12:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:42 GMT