![]() ![]() ![]() ![]() |
Before you begin
Create an XML registry and associate it with your WebLogic Server instance. For details, see Create an XML registry.
External entities are chunks of text that are not literally part of an XML document, but are referenced inside the XML document. The actual text might reside anywhere - in another file on the same computer or even somewhere on the Web. While parsing a document, if the parser encounters an external entity reference, it fetches the referenced chunk of text, places the text in the XML document, then continues parsing. An example of an external entity is a DTD; rather than including the full text of the DTD in the XML document, the XML document has a reference to the DTD that is stored in a separate file.
When you configure external entity resolution with WebLogic Server, you physically copy the entity files to a directory accessible by the WebLogic Administration Server, and specify that the Administration Server use the local copy whenever the external entity is referenced in an XML document.
The procedure in this topic uses the following XML file as an example:
<?xml version="1.0"?> <!-- This XML document describes a car --> <!DOCTYPE CAR PUBLIC "-//BEA Systems, Inc.//DTD for cars//EN" "http://www.bea.com/dtds/car.dtd"> <CAR> <MAKE>Toyota</MAKE> <MODEL>Corrolla</MODEL> <YEAR>1998</YEAR> <ENGINE>1.5L</ENGINE> <HP>149</HP> </CAR>
To configure an external entity resolution entry:
-//BEA Systems,
Inc.//DTD for cars//EN
.
http://www.bea.com/dtds/car.dtd
.
DOMAIN
/xml/registries/
reg_name
exists, where
DOMAIN
refers
to your domain directory and reg_name
is the name
of your XML registry. If it does not exist, create it.
DOMAIN
/xml/registries/
reg_name
.
For example, for the
car.xml
file,
you might enter dtds/car.dtd
in the
Entity URI field.
http://java.sun.com/j2ee/dtds/application_1_2.dtd
to reference the DTD for the application.xml
file used
to describe J2EE Enterprise Applications or use jdbc:
to reference an
entity in a database.
Use the following protocol
declarations to specify an external entity: http://
, file://
, jdbc:
, or ftp://
.
cache-on-reference
:
WebLogic Server caches the external entity referenced by a URL the
first time the entity is referenced in an XML document.
cache-at-initialization
:
WebLogic Server caches the entity when the server starts.
defer-to-registry-setting
:
WebLogic Server uses the default caching setting.
cache-never
: WebLogic
Server never caches the external entity.
The default value for this field is -1, which means that the global timeout value for WebLogic Server is used.
For example, you would copy
the car.dtd
file to
the directory DOMAIN
/xml/registries/
reg_name
/dtds
, where DOMAIN
refers to
your domain directory and reg_name
is the name
of your XML registry.
After you finish
Create an XML entity cache and associate it with your WebLogic Server instance. See Create an XML Entity Cache.
![]() |