<s>
XML	B-Protocol
documents	I-Protocol
typically	O
refer	O
to	O
external	O
entities	O
,	O
for	O
example	O
the	O
public	O
and/or	O
system	O
ID	O
for	O
the	O
Document	B-Language
Type	I-Language
Definition	I-Language
.	O
</s>
<s>
Relying	O
on	O
remote	O
resources	O
makes	O
XML	B-Protocol
processing	O
susceptible	O
to	O
both	O
planned	O
and	O
unplanned	O
network	O
downtime	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
URL	O
"	O
../../xml/dtd/docbookx.xml	O
"	O
will	O
usually	O
only	O
be	O
useful	O
in	O
very	O
limited	O
circumstances	O
.	O
</s>
<s>
One	O
way	O
to	O
avoid	O
these	O
problems	O
is	O
to	O
use	O
an	O
entity	O
resolver	O
(	O
a	O
standard	O
part	O
of	O
SAX	B-Application
)	O
or	O
a	O
URI	O
Resolver	O
(	O
a	O
standard	O
part	O
of	O
JAXP	B-Language
)	O
.	O
</s>
<s>
The	O
XML	B-Language
catalog	I-Language
is	O
a	O
document	O
describing	O
a	O
mapping	O
between	O
external	O
entity	O
references	O
and	O
locally	O
cached	O
equivalents	O
.	O
</s>
<s>
The	O
following	O
example	O
shows	O
how	O
,	O
in	O
Java	O
,	O
a	O
SAX	B-Application
parser	I-Application
may	O
be	O
created	O
to	O
parse	O
some	O
input	O
source	O
in	O
which	O
the	O
org.apache.xml.resolver.tools.CatalogResolver	O
is	O
used	O
to	O
resolve	O
external	O
entities	O
to	O
locally	O
cached	O
instances	O
.	O
</s>
<s>
This	O
resolver	O
originates	O
from	O
Apache	B-Language
Xerces	I-Language
but	O
is	O
now	O
included	O
with	O
the	O
Sun	O
Java	O
runtime	O
.	O
</s>
<s>
The	O
XML	B-Protocol
reader	O
entity	O
resolver	O
should	O
be	O
set	O
to	O
the	O
default	O
or	O
to	O
a	O
customly-made	O
one	O
.	O
</s>
<s>
It	O
is	O
important	O
to	O
call	O
the	O
parse	O
method	O
on	O
the	O
reader	O
,	O
not	O
on	O
the	O
SAX	B-Application
parser	I-Application
.	O
</s>
