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.
DOMAINrefers to your domain directory and
reg_nameis the name of your XML registry. If it does not exist, create it.
http://java.sun.com/j2ee/dtds/application_1_2.dtdto reference the DTD for the
application.xmlfile used to describe J2EE Enterprise Applications or use
jdbc:to reference an entity in a database.
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.
After you finish
Create an XML entity cache and associate it with your WebLogic Server instance. See Create an XML Entity Cache.