Before you begin
Create an XML registry and associate it with your WebLogic Server instance. For details, see Create an XML registry.
Configuring a parser for a particular document type means that whenever WebLogic Server parses an XML document of that type, it uses the parser you specify, rather than the default WebLogic Server parser. You use the document system ID, public ID, or root element name to identify the document type. For simplicity, the following procedure uses the term parser select entry to specify an entry in an XML registry that associates a parser with a specific XML document type.
Note: WebLogic Server searches only the first 1000 bytes of an XML document when attempting to identify its document type. If it does not find a DOCTYPE identifier in those first 1000 bytes, it stops searching the document and uses the default parser configured for the WebLogic Server instance to parse the document.
The procedure for this task uses the following XML file:
<?xml version="1.0"?> <!-- This XML document describes a car --> <!DOCTYPE CAR PUBLIC "-//Oracle//DTD for cars//EN" "http://www.oracle.com/dtds/car.dtd"> <CAR> <MAKE>Toyota</MAKE> <MODEL>Corrolla</MODEL> <YEAR>1998</YEAR> <ENGINE>1.5L</ENGINE> <HP>149</HP> </CAR>
To configure a parser select entry:
-//Oracle//DTD for
cars//EN
.
http://www.oracle.com/dtds/car.dtd
.
CAR
. If your XML document defines a
namespace, be sure to enter the fully qualified root element name,
such as VEHICLES:CAR
.
avax.xml.parsers.DocumentBuilderFactory
interface
(for DOM processing) and
javax.xml.parsers.SaxParserFactory
(for SAX
processing) in the Document Builder Factory or
Sax Parser Factory fields, respectively.
WebLogic Server will use these classes when getting a parser to parse
XML documents of the specified type.
Note: Do not enter any information in the Parser Class Name field; this field is for backward compatibility with previous versions of WebLogic Server only.