W3C home > Mailing lists > Public > www-style@w3.org > March 2008

Re: CSS instead of Namespace

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Fri, 07 Mar 2008 08:56:17 +0100
To: Dmitry Turin <dev3os@narod.ru>
Cc: www-style@w3.org
Message-ID: <lts1t35dvukjt1mjajbc84j332e94v3k6v@hive.bjoern.hoehrmann.de>

* Dmitry Turin wrote:
>I propose to specify namespace not only in tags themselves,
>but also in CSS, what is more convenient in much cases. E.g.
>
><?xml version="1.0" encoding="utf-8"?>
><?xml-stylesheet    type="text/css"  href="my-style.css"?>
><document>
>  <m>nnn</m>
>  <s href="k.xml">
>    <t>
>      <a href="r.xml">Error</a>
>    </t>
>  </s>
></document>
>
>with the following content of file 'my-style.css':
>
>s {
>  namespace: xinclude;
>  element:   include;
>}
>t {
>  namespace: xinclude;
>  element:   fallback;
>}
>
>instead of
>
><?xml version="1.0" encoding="utf-8"?>
><document xmlns:i="http://www.w3.org/2001/xinclude">
>  <m>nnn</m>
>  <i:include href="k.xml" >
>    <i:fallback>
>      <a href="r.xml">Error</a>
>    </i:fallback>
>  </i:include>
></document>

Your style sheet essentially contains rules how to transform the source
document into this result document. XSLT already does this nicely, your
style sheet would look similar to this:

  ...
  <xsl:template match='s'>
    <xinclude:include>
      <xsl:apply-templates/>
    </xinclude:include>
  <xsl:template match='s'>

  <xsl:template match='t'>
    <xinclude:fallback>
      <xsl:apply-templates/>
    </xinclude:fallback>
  <xsl:template match='t'>
  ...

Along with the idenity transformation and the necessary namespace de-
clarations. There is no place for this in CSS as that would create a
number of problems, e.g. if you use s:hover { namespace: ... }.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Friday, 7 March 2008 07:56:42 GMT

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