Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 75993 invoked from network); 6 Jul 2004 00:22:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Jul 2004 00:22:44 -0000 Received: (qmail 99373 invoked by uid 500); 6 Jul 2004 00:22:50 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 99328 invoked by uid 500); 6 Jul 2004 00:22:49 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 99307 invoked by uid 99); 6 Jul 2004 00:22:49 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.27.1) with SMTP; Mon, 05 Jul 2004 17:22:47 -0700 Received: (qmail 10059 invoked by uid 50); 6 Jul 2004 00:23:43 -0000 Date: 6 Jul 2004 00:23:43 -0000 Message-ID: <20040706002343.10058.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: dev@cocoon.apache.org Cc: Subject: DO NOT REPLY [Bug 29924] New: - [PATCH] XML CSS engine X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=29924 [PATCH] XML CSS engine Summary: [PATCH] XML CSS engine Product: Cocoon 2 Version: Current CVS 2.2 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Samples AssignedTo: dev@cocoon.apache.org ReportedBy: eburghar@free.fr XML CSS engine with macro preprocessor and agent targeting. patch follows ----------- diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/samples.xml cocoon-2.2.new/src/webapp/samples/samples.xml 56a57,63 > > CSS interpretation is far from beeing uniform among browsers. The > proposed XMLCSS subsystem is able to serve, from one centralized xml description, > well suited text/css files for a specific browser or a browser family. The preprocessor > engine let you easily define values (eg. colors, fonts) that can be shared with other > xmlcss files. > diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/css/defines_css.xml cocoon-2.2.new/src/webapp/samples/xmlcss/css/defines_css.xml 0a1,31 > > > > > > > > > > > > > > > > > diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/css/example_css.xml cocoon-2.2.new/src/webapp/samples/xmlcss/css/example_css.xml 0a1,97 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/example.xhtml cocoon-2.2.new/src/webapp/samples/xmlcss/example.xhtml 0a1,80 > > > > > > Browser Rating > > > >
>

Browser rating

>

The rule below show my preferences over some famliar browsers. Test this page on different ones.

>
minmax
>

Description

>

An xmlcss file is just an xmlifaction of a css file:

>
    >
  • The root must be <css/>
  • >
  • You define rules which can contains any number of attributes
    > > <rule select="body">
    > <margin value="0"/>
    > </rule> >
    >
  • >
  • You can use <include src="file.xml"/> at top level
  • >
  • You can define some macros at top level >
      >
    • single attribute: <define name="foo" value="white"/>
    • >
    • multiple attributes: <define name="bar" left="10pt" right="10pt"/>
    • >
    >
  • >
  • You can use expressions in values an attributes >
      >
    • single attribute: <background color="{$foo}"/>
    • >
    • multiple attributes: <margin value="{@bar}"/>
    • >
    • expression (xpath): <width value="{100 - (2 * $hmargin)}%">
    • >
    >
  • >
  • You can use an agent attribute on any element (css, include, rule or attributes) to target a > specific browser. agent are defined in agent.xsl. agent is a list or an exclusion list if it begins with !. >
      >
    • <float value="left" agent="ie5mac ie4"/>
    • >
    • <float value="non" agent="! ie5mac ie4"/>
    • >
    >
  • >
>

Bugs

>
    >
  • Use some exsl extension (node-set, dynamic, func), not always stable or user-friendly but enhance > readability and reduce the amount of lines code.
  • >
  • It's based entirely on xslt via a metastylesheet. Errors are generaly hidden. Proceed step by step, look directly at the > generated css, consult the logs.
  • >
  • CSS like multiple definition, XSLT normally don't. Xalan don't complains about multiple defined variable > (at least it takes the last and this what we want in cascading policy). Try to avoid multiple define (define are > handled with xslt variables) with the same name at the same time (use agent="something" and agent="! something" > for the default define).
  • >
>

TODO

>
    >
  • Syntax checking (XML Schema ?).
  • >
  • Agent aliasing is done throught an xslt variable which is defined in a standalone xslt file. Perhaps could we made > an action to setup things in the sitemap.
  • >
>
> > \ Pas de fin de ligne à la fin du fichier. diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/samples.xml cocoon-2.2.new/src/webapp/samples/xmlcss/samples.xml 0a1,31 > > > > > > > > Back to the samples home page. > > > > > > This page is showned differently on mozilla, konqueror, opera and ie5. > > > diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/sitemap.xmap cocoon-2.2.new/src/webapp/samples/xmlcss/sitemap.xmap 0a1,80 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > \ Pas de fin de ligne à la fin du fichier. diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/style/cssdefines.xsl cocoon-2.2.new/src/webapp/samples/xmlcss/style/cssdefines.xsl 1,38d0 < < < < < < < < < < < < < < < < < < < < < < diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/style/metaxml2css.xsl cocoon-2.2.new/src/webapp/samples/xmlcss/style/metaxml2css.xsl 1,281d0 < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < '' < < < < < < < < < < < < < < < < < < < < < < < < < < < < < { < < < } < < < < < < < < < < < < starts-with($word, '{@') < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < not(contains($str, '{')) < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < not(contains($word, '{')) < < < < < substring-before($word, '{') < < < < < < < word < concat('{', substring-after($word, '{')) < < < < < < < < substring-before($word, '}') < < < < < < word < substring-after($word, '}') < < < < < < < < < < < < < < < < < < < < < < < < < < : < ; < < < < < < < < < < < < < < diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/samples/xmlcss/style/short-agent.xsl cocoon-2.2.new/src/webapp/samples/xmlcss/style/short-agent.xsl 1,35d0 < < < < < < < < opera < mozilla < konqueror < ie4 < ie5mac < ie5 < ie6 < ie < unknown < < < \ Pas de fin de ligne à la fin du fichier. diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/stylesheets/css/agent.xsl cocoon-2.2.new/src/webapp/stylesheets/css/agent.xsl 0a1,35 > > > > > > > > opera > mozilla > konqueror > ie4 > ie5mac > ie5 > ie6 > ie > unknown > > > \ Pas de fin de ligne à la fin du fichier. diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/stylesheets/css/cssdefines.xsl cocoon-2.2.new/src/webapp/stylesheets/css/cssdefines.xsl 0a1,50 > > > xmlns:func="http://exslt.org/functions" xmlns:my="http://cocoon.apache.org/functions" > version="1.0" exclude-result-prefixes="func my"> > > > > > > > > > > > > > > > > > > > > > > > > > > diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/stylesheets/css/is-for-agent.xsl cocoon-2.2.new/src/webapp/stylesheets/css/is-for-agent.xsl 0a1,65 > > > xmlns:my="http://cocoon.apache.org/functions" version="1.0"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > \ Pas de fin de ligne à la fin du fichier. diff -r --new-file --exclude='*.class' cocoon-2.2/src/webapp/stylesheets/css/metaxml2css.xsl cocoon-2.2.new/src/webapp/stylesheets/css/metaxml2css.xsl 0a1,216 > > > xmlns:xso="http://alias/Transform" > xmlns:func="http://exslt.org/functions" > xmlns:funo="http://alias/functions" > xmlns:exsl="http://exslt.org/common" > xmlns:dyn="http://exslt.org/dynamic" > xmlns:my="http://cocoon.apache.org/functions" > version="1.0" exclude-result-prefixes="func"> > > > > > > > > > > > > '' > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > { > > > } > > > > > > > > > > > > starts-with($word, '{@') > > > > > > > > > > > > > > > > > > > > > > > > > > > not(contains($word, '{')) > > > > > substring-before($word, '{') > > > > > > > word > concat('{', substring-after($word, '{')) > > > > > > > > substring-before($word, '}') > > > > > > word > substring-after($word, '}') > > > > > > > > > > > > > > > > > > > > > > > > > > : > > > > starts-with($value,'{') and substring($value, string-length($value))='}' > > > > > contains($value, '{') and contains($value, '}') > > > > > > > ; > > > > > > > > > > > > > >