40 import sun.reflect.misc.ReflectUtil;
41
42 /**
43 * A DOM-based CatalogReader.
44 *
45 * <p>This class is used to read XML Catalogs using the DOM. This reader
46 * has an advantage over the SAX-based reader that it can analyze the
47 * DOM tree rather than simply a series of SAX events. It has the disadvantage
48 * that it requires all of the code necessary to build and walk a DOM
49 * tree.</p>
50 *
51 * <p>Since the choice of CatalogReaders (in the InputStream case) can only
52 * be made on the basis of MIME type, the following problem occurs: only
53 * one CatalogReader can exist for all XML mime types. In order to get
54 * around this problem, the DOMCatalogReader relies on a set of external
55 * CatalogParsers to actually build the catalog.</p>
56 *
57 * <p>The selection of CatalogParsers is made on the basis of the QName
58 * of the root element of the document.</p>
59 *
60 * <p>This class requires the <a href="http://java.sun.com/aboutJava/communityprocess/final/jsr005/index.html">Java API for XML Parsing</a>.</p>
61 *
62 * @see Catalog
63 * @see CatalogReader
64 * @see SAXCatalogReader
65 * @see TextCatalogReader
66 * @see DOMCatalogParser
67 *
68 * @author Norman Walsh
69 * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
70 *
71 */
72 public class DOMCatalogReader implements CatalogReader {
73 /**
74 * Mapping table from QNames to CatalogParser classes.
75 *
76 * <p>Each key in this hash table has the form "elementname"
77 * or "{namespaceuri}elementname". The former is used if the
78 * namespace URI is null.</p>
79 */
80 protected Hashtable namespaceMap = new Hashtable();
|
40 import sun.reflect.misc.ReflectUtil;
41
42 /**
43 * A DOM-based CatalogReader.
44 *
45 * <p>This class is used to read XML Catalogs using the DOM. This reader
46 * has an advantage over the SAX-based reader that it can analyze the
47 * DOM tree rather than simply a series of SAX events. It has the disadvantage
48 * that it requires all of the code necessary to build and walk a DOM
49 * tree.</p>
50 *
51 * <p>Since the choice of CatalogReaders (in the InputStream case) can only
52 * be made on the basis of MIME type, the following problem occurs: only
53 * one CatalogReader can exist for all XML mime types. In order to get
54 * around this problem, the DOMCatalogReader relies on a set of external
55 * CatalogParsers to actually build the catalog.</p>
56 *
57 * <p>The selection of CatalogParsers is made on the basis of the QName
58 * of the root element of the document.</p>
59 *
60 *
61 * @see Catalog
62 * @see CatalogReader
63 * @see SAXCatalogReader
64 * @see TextCatalogReader
65 * @see DOMCatalogParser
66 *
67 * @author Norman Walsh
68 * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
69 *
70 */
71 public class DOMCatalogReader implements CatalogReader {
72 /**
73 * Mapping table from QNames to CatalogParser classes.
74 *
75 * <p>Each key in this hash table has the form "elementname"
76 * or "{namespaceuri}elementname". The former is used if the
77 * namespace URI is null.</p>
78 */
79 protected Hashtable namespaceMap = new Hashtable();
|