EXIficient for CSS

EXIficient is an open source implementation of the W3C Efficient XML Interchange (EXI) format specification written in the Java programming language. The EXI format is a very compact representation for the Extensible Markup Language (XML) Information Set that is intended to simultaneously optimize performance and the utilization of computational resources.

License

License

GroupId

GroupId

com.siemens.ct.exi
ArtifactId

ArtifactId

exificient-for-css
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

EXIficient for CSS
EXIficient is an open source implementation of the W3C Efficient XML Interchange (EXI) format specification written in the Java programming language. The EXI format is a very compact representation for the Extensible Markup Language (XML) Information Set that is intended to simultaneously optimize performance and the utilization of computational resources.
Project URL

Project URL

http://exificient.github.io/
Project Organization

Project Organization

Siemens AG
Source Code Management

Source Code Management

https://github.com/EXIficient/exificient-for-css

Download exificient-for-css

How to add to project

<!-- https://jarcasting.com/artifacts/com.siemens.ct.exi/exificient-for-css/ -->
<dependency>
    <groupId>com.siemens.ct.exi</groupId>
    <artifactId>exificient-for-css</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.siemens.ct.exi/exificient-for-css/
implementation 'com.siemens.ct.exi:exificient-for-css:1.0.4'
// https://jarcasting.com/artifacts/com.siemens.ct.exi/exificient-for-css/
implementation ("com.siemens.ct.exi:exificient-for-css:1.0.4")
'com.siemens.ct.exi:exificient-for-css:jar:1.0.4'
<dependency org="com.siemens.ct.exi" name="exificient-for-css" rev="1.0.4">
  <artifact name="exificient-for-css" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.siemens.ct.exi', module='exificient-for-css', version='1.0.4')
)
libraryDependencies += "com.siemens.ct.exi" % "exificient-for-css" % "1.0.4"
[com.siemens.ct.exi/exificient-for-css "1.0.4"]

Dependencies

compile (4)

Group / Artifact Type Version
org.w3c.css : sac jar 1.3
net.sourceforge.cssparser : cssparser jar 0.9.26
com.siemens.ct.exi : exificient jar 1.0.4
org.meteogroup.jbrotli » jbrotli jar 0.5.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.11
com.yahoo.platform.yui : yuicompressor jar 2.4.8

Project Modules

There are no modules declared in this project.

exificient-for-css

EXI for CSS (Explorative) - How EXI can be used to represent CSS efficiently w.r.t.

  • Size and
  • Processing speed

Build Status

Document Object Model (DOM) Style Specification

We use the CSS Parser which reads Cascading Style Sheets (CSS3, CSS2.1, CSS2, and CSS1) and generates a CSS Object Model (CSSOM).

By means of an XML schema we then efficiently represent the style information with EXI.

On the contrary the efficient representation can be transformed back to plain-text CSS, DOM Style, or alternatively provided as events.

Sample

CSS

body {
    background-color: #d0e4fe;
}
h1 {
    color: orange;
    text-align: center;
}
p {
    font-family: "Times New Roman";
    font-size: 20px;
}

CSS Object Model (visualized as XML)

<stylesheet>
    <cssStyleRule>
        <selectorText>body</selectorText>
        <style>
            <property>background-color</property>
            <cssValue>
                <cssPrimitiveValue>
                    <cssRgbColor>
                        <r>208</r>
                        <g>228</g>
                        <b>254</b>
                    </cssRgbColor>
                </cssPrimitiveValue>
            </cssValue>
        </style>
    </cssStyleRule>
    <cssStyleRule>
        <selectorText>h1</selectorText>
        <style>
            <property>color</property>
            <cssValue>
                <cssPrimitiveValue>
                    <cssIdent>orange</cssIdent>
                </cssPrimitiveValue>
            </cssValue>
            <property>text-align</property>
            <cssValue>
                <cssPrimitiveValue>
                    <cssIdent>center</cssIdent>
                </cssPrimitiveValue>
            </cssValue>
        </style>
    </cssStyleRule>
    <cssStyleRule>
        <selectorText>p</selectorText>
        <style>
            <property>font-family</property>
            <cssValue>
                <cssPrimitiveValue>
                    <cssString>Times New Roman</cssString>
                </cssPrimitiveValue>
            </cssValue>
            <property>font-size</property>
            <cssValue>
                <cssPrimitiveValue>
                    <cssPx>20.0</cssPx>
                </cssPrimitiveValue>
            </cssValue>
        </style>
    </cssStyleRule>
</stylesheet>

Early Results

See test-data in https://github.com/EXIficient/exificient-for-css/tree/master/data.

Compression

TestCase CSS [Size in Bytes] Minified CSS [Size in Bytes] EXI 4 CSS [Size in Bytes]
data/boa.css 120184 106666 34894
data/w3c.css 12714 12115 6215
data/wsj.css 96605 79114 34367
data/rules.css 1259 817 609
data/fujitsu.css 60085 51979 19366
data/amazon.css 129740 107724 57436
data/css2_1.css 2855 1884 1392
data/css3_1.css 521 328 234
data/design.css 166 111 114
data/module.css 2056 1670 785
data/yahoo_japan.css 52237 42645 20329
data/capitalone.css 44676 36883 17552

On average "EXI for CSS" is about 43% of the original CSS filesize!

Compression Figure

com.siemens.ct.exi

Versions

Version
1.0.4
1.0.1
1.0.0
0.9.7
0.9.6