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: Noah Scales <noahjscales@yahoo.com>
Date: Wed, 14 Dec 2005 21:03:43 -0800 (PST)
Message-ID: <20051215050343.60756.qmail@web50402.mail.yahoo.com>
To: Laurens Holst <lholst@students.cs.uu.nl>
Cc: www-style@w3.org

Hi, Laurens.

You wrote that CSS-defined custom mark-up languages
are not accessible. How about accessible to ordinary
hypertext users? They are potential hypertext authors.
So are opendocument and docbook authors. 

Hmm, how about adding a "webpage" value to the CSS
display attribute to break up those long XML pages?
Allowing xpointer expressions as urls? Well, I'm
getting carried away.

But consider:

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="bob.css"?>
<document xmlns="http://www.bobswebsite.com/bob.dtd">
<browser-title>Hi, this is bob's
homepage.</browser-title>
<image>
<picture location="./mypicture.jpg" />
<caption>Dapper Bob</caption>
</image>
<paragraph>Hi, my name is Bob, welcome.</paragraph>
<paragraph>Visit: <link target="aboutme.xml">All About
Me</link>.</paragraph>
</document>

Compare:

<html>
<head>
<title>Hi, this is bob's homepage.</title>
<link rel="stylesheet" type="text/css" href="bob.css"
/>
</head>
<body>
<table class="image">
<tr><td><img src="mypicture.jpg" /></td></tr>
<tr><td class="caption">Dapper Bob</td></tr>
</table>
<p>Hi, my name is Bob, welcome.</p>
<p>Visit: <a href="about.htm">All About Me</a>.</p>
</body>
</html>

Bob uses CSS so that his hypertext will be meaningful
to a browser, that is, so that a browser will know how
to display it. Bob also uses a DTD. But Bob doesn't
use RDF. Bob's CSS looks like:

browser-title  {display:browser-bar-title;}
image  {display:table-cell;}
picture 
{display:block-image;image-url:attr(location);}
caption  {display:inline;}
link  {display:hyperlink;hyperlink-url:attr(target);}
paragraph {display:block;}

or in XML:

<?xml version="1.0"?>
<selectors xmlns="http://www.w3.org/2006/CSS">
<selector value="/document/browser-title">
<display setting="browser-bar-title" />
</selector>
<selector value="/document//image">
<display setting="table-cell" />
</selector>
<selector value="/document//image/picture">
<display setting="block-image" />
<image-url setting="xpath(./@location)" />
</selector>
<selector value="/document//image/caption">
<display setting="inline" />
</selector>
<selector value="/document//image/@url">
<display setting="hyperlink" />
<hyperlink-url setting="xpath(./@target)" />
</selector>
<selector value="/document//paragraph">
<display setting="block" />
</selector>
</selectors>

Once Google interpret's Bob's CSS, Google images can
show you
Bob's picture and spider Bob's "About Me" page.

My CSS examples are an HTML handcoder's idea of how
CSS allows browsers to display custom hypertext. If
you've spent much time handcoding HTML, you might
appreciate why custom hypertext mark-up appeals to me.

I've been getting carried away, so I think I'll leave
the list. Thank you all for your responses and good
information. My apologies for the syntax and semantics
errors.

-Noah

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Received on Thursday, 15 December 2005 05:03:47 GMT

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