<s>
Tritium	B-Language
is	O
a	O
simple	O
scripting	O
language	O
for	O
efficiently	O
transforming	B-Language
structured	O
data	O
like	O
HTML	B-Language
,	O
XML	B-Protocol
,	O
and	O
JSON	B-General_Concept
.	O
</s>
<s>
It	O
is	O
similar	O
in	O
purpose	O
to	O
XSLT	B-Application
but	O
has	O
a	O
syntax	O
influenced	O
by	O
jQuery	B-Language
,	O
Sass	B-Language
,	O
and	O
CSS	B-Language
versus	O
XSLT	B-Application
's	O
XML	B-Protocol
based	O
syntax	O
.	O
</s>
<s>
Tritium	B-Language
was	O
designed	O
by	O
Hampton	O
Catlin	O
,	O
the	O
creator	O
of	O
languages	O
Sass	B-Language
and	O
Haml	B-Application
and	O
is	O
currently	O
bundled	O
with	O
the	O
Moovweb	O
mobile	O
platform	O
.	O
</s>
<s>
As	O
with	O
Sass	B-Language
(	O
created	O
to	O
address	O
deficiencies	O
in	O
CSS	B-Language
)	O
and	O
Haml	B-Application
(	O
created	O
to	O
address	O
deficiencies	O
in	O
coding	O
HTML	B-Language
templates	O
)	O
,	O
Catlin	O
designed	O
Tritium	B-Language
to	O
address	O
issues	O
he	O
saw	O
with	O
XSLT	B-Application
while	O
preserving	O
the	O
core	O
benefits	O
of	O
a	O
transformation	O
language	O
.	O
</s>
<s>
Open	O
Tritium	B-Language
is	O
the	O
open	O
source	O
implementation	O
of	O
the	O
Tritium	B-Language
language	O
.	O
</s>
<s>
It	O
was	O
presented	O
at	O
O'Reilly	O
Open	O
Source	O
Convention	O
2014	O
and	O
the	O
compiler	O
is	O
implemented	O
in	O
Go	B-Application
.	O
</s>
<s>
Tritium	B-Language
takes	O
as	O
input	O
HTML	B-Language
,	O
XML	B-Protocol
,	O
or	O
JSON	B-General_Concept
documents	O
and	O
outputs	O
HTML	B-Language
,	O
XML	B-Protocol
,	O
or	O
JSON	B-General_Concept
data	O
that	O
has	O
been	O
transformed	O
according	O
to	O
the	O
rules	O
defined	O
in	O
the	O
Tritium	B-Language
script	O
.	O
</s>
<s>
Like	O
jQuery	B-Language
,	O
idiomatic	O
Tritium	B-Language
code	O
is	O
structured	O
around	O
selecting	O
a	O
collection	O
of	O
elements	O
via	O
a	O
CSS	B-Language
or	O
XPath	B-Language
selector	O
and	O
then	O
chaining	O
a	O
series	O
of	O
operations	O
on	O
them	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
script	O
will	O
select	O
all	O
the	O
HTML	B-Language
table	O
elements	O
with	O
id	O
of	O
foo	O
and	O
change	O
their	O
width	O
attributes	O
to	O
100%	O
.	O
</s>
<s>
While	O
Tritium	B-Language
supports	O
both	O
XPath	B-Language
and	O
CSS	B-Language
selectors	O
via	O
the	O
$( 	O
)	O
and	O
$$( 	O
)	O
functions	O
(	O
respectively	O
)	O
,	O
the	O
preferred	O
usage	O
is	O
XPath	B-Language
.	O
</s>
<s>
For	O
example	O
,	O
the	O
above	O
code	O
rewritten	O
to	O
use	O
the	O
equivalent	O
XPath	B-Language
selector	O
would	O
be	O
:	O
</s>
<s>
Both	O
Tritium	B-Language
and	O
XSLT	B-Application
are	O
designed	O
for	O
transforming	B-Language
data	O
.	O
</s>
<s>
However	O
,	O
Tritium	B-Language
differs	O
in	O
key	O
ways	O
to	O
make	O
it	O
more	O
familiar	O
and	O
easier	O
to	O
use	O
for	O
web	O
developers	O
:	O
</s>
<s>
Familiar	O
syntax	O
:	O
Tritium	B-Language
's	O
syntax	O
is	O
similar	O
to	O
CSS	B-Language
and	O
jQuery	B-Language
so	O
that	O
it	O
is	O
more	O
familiar	O
and	O
readable	O
to	O
web	O
developers	O
than	O
the	O
XML	B-Protocol
based	O
syntax	O
of	O
XSLT	B-Application
.	O
</s>
<s>
Imperative	O
style	O
:	O
Tritium	B-Language
uses	O
an	O
imperative	O
programming	O
style	O
instead	O
of	O
the	O
functional	O
and	O
recursive	O
processing	O
model	O
of	O
XSLT	B-Application
.	O
</s>
<s>
Input	O
transparency	O
:	O
In	O
XSLT	B-Application
any	O
input	O
elements	O
that	O
are	O
not	O
specified	O
by	O
a	O
transform	O
rule	O
are	O
removed	O
from	O
the	O
output	O
.	O
</s>
<s>
Tritium	B-Language
reverses	O
this	O
behavior	O
:	O
any	O
input	O
elements	O
that	O
are	O
not	O
specified	O
by	O
a	O
transform	O
rule	O
are	O
passed	O
to	O
the	O
output	O
unchanged	O
.	O
</s>
<s>
HTML-compatible	O
:	O
Tritium	B-Language
was	O
designed	O
to	O
process	O
HTML	B-Language
,	O
XML	B-Protocol
,	O
and	O
JSON	B-General_Concept
,	O
whereas	O
XSLT	B-Application
only	O
works	O
on	O
XML	B-Protocol
.	O
</s>
