Re: CSS instead of Namespace

* 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 UTC