<s>
Expat	B-Language
is	O
a	O
stream-oriented	O
XML	B-Protocol
1.0	I-Protocol
parser	O
library	B-Library
,	O
written	O
in	O
C	B-Language
.	O
As	O
one	O
of	O
the	O
first	O
available	O
open-source	B-Application
XML	B-Protocol
parsers	I-Protocol
,	O
Expat	B-Language
has	O
found	O
a	O
place	O
in	O
many	O
open-source	B-Application
projects	O
.	O
</s>
<s>
Such	O
projects	O
include	O
the	O
Apache	B-Application
HTTP	I-Application
Server	I-Application
,	O
Mozilla	B-Operating_System
,	O
Perl	B-Language
,	O
Python	B-Language
and	O
PHP	B-Application
.	O
</s>
<s>
It	O
is	O
also	O
bound	B-Application
in	O
many	O
other	O
languages	O
.	O
</s>
<s>
Software	O
developer	O
James	O
Clark	O
released	O
version	O
1.0	O
in	O
1998	O
while	O
serving	O
as	O
technical	O
lead	O
on	O
the	O
XML	B-Protocol
Working	O
Group	O
at	O
the	O
World	O
Wide	O
Web	O
Consortium	O
.	O
</s>
<s>
GitHub	B-Application
hosts	O
the	O
Expat	B-Language
project	O
.	O
</s>
<s>
To	O
use	O
the	O
Expat	B-Language
library	B-Library
,	O
programs	O
first	O
register	O
handler	O
functions	O
with	O
Expat	B-Language
.	O
</s>
<s>
When	O
Expat	B-Language
parses	O
an	O
XML	B-Protocol
document	I-Protocol
,	O
it	O
calls	O
the	O
registered	O
handlers	O
as	O
it	O
finds	O
relevant	O
tokens	O
in	O
the	O
input	B-Architecture
stream	I-Architecture
.	O
</s>
<s>
Typically	O
,	O
programs	O
register	O
handler	O
functions	O
for	O
XML	B-Protocol
element	O
start	O
or	O
stop	O
events	O
and	O
character	O
events	O
.	O
</s>
<s>
Expat	B-Language
provides	O
facilities	O
for	O
more	O
sophisticated	O
event	O
handling	O
such	O
as	O
XML	B-Language
Namespace	I-Language
declarations	O
,	O
processing	O
instructions	O
and	O
DTD	B-Language
events	O
.	O
</s>
<s>
Expat	B-Language
's	O
parsing	O
events	O
resemble	O
the	O
events	O
defined	O
in	O
the	O
Simple	B-Application
API	I-Application
for	I-Application
XML	I-Application
(	O
SAX	O
)	O
,	O
but	O
Expat	B-Language
is	O
not	O
a	O
SAX-compliant	O
parser	O
.	O
</s>
<s>
Projects	O
incorporating	O
the	O
Expat	B-Language
library	B-Library
often	O
build	O
SAX	O
and	O
possibly	O
DOM	B-General_Concept
parsers	O
on	O
top	O
of	O
Expat	B-Language
.	O
</s>
<s>
While	O
Expat	B-Language
is	O
mainly	O
a	O
stream-based	O
(	O
push	O
)	O
parser	O
,	O
it	O
supports	O
stopping	O
and	O
restarting	O
parsing	O
at	O
arbitrary	O
times	O
,	O
thus	O
making	O
the	O
implementation	O
of	O
a	O
pull	O
parser	O
relatively	O
easy	O
as	O
well	O
.	O
</s>
