78 * the document in a "normal" form. The actual result depends on the features being set
79 * and governing what operations actually take place. See setNormalizationFeature for details.
80 * Noticeably this method normalizes Text nodes, makes the document "namespace wellformed",
81 * according to the algorithm described below in pseudo code, by adding missing namespace
82 * declaration attributes and adding or changing namespace prefixes, updates the replacement
83 * tree of EntityReference nodes, normalizes attribute values, etc.
84 * Mutation events, when supported, are generated to reflect the changes occuring on the
85 * document.
86 * See Namespace normalization for details on how namespace declaration attributes and prefixes
87 * are normalized.
88 *
89 * NOTE: There is an initial support for DOM revalidation with XML Schema as a grammar.
90 * The tree might not be validated correctly if entityReferences, CDATA sections are
91 * present in the tree. The PSVI information is not exposed, normalized data (including element
92 * default content is not available).
93 *
94 * @xerces.experimental
95 *
96 * @author Elena Litani, IBM
97 * @author Neeraj Bajaj, Sun Microsystems, inc.
98 * @version $Id: DOMNormalizer.java,v 1.9 2010-11-01 04:39:38 joehw Exp $
99 */
100 public class DOMNormalizer implements XMLDocumentHandler {
101
102 //
103 // constants
104 //
105 /** Debug normalize document*/
106 protected final static boolean DEBUG_ND = false;
107 /** Debug namespace fix up algorithm*/
108 protected final static boolean DEBUG = false;
109 /** Debug document handler events */
110 protected final static boolean DEBUG_EVENTS = false;
111
112 /** prefix added by namespace fixup algorithm should follow a pattern "NS" + index*/
113 protected final static String PREFIX = "NS";
114
115 //
116 // Data
117 //
118 protected DOMConfigurationImpl fConfiguration = null;
|
78 * the document in a "normal" form. The actual result depends on the features being set
79 * and governing what operations actually take place. See setNormalizationFeature for details.
80 * Noticeably this method normalizes Text nodes, makes the document "namespace wellformed",
81 * according to the algorithm described below in pseudo code, by adding missing namespace
82 * declaration attributes and adding or changing namespace prefixes, updates the replacement
83 * tree of EntityReference nodes, normalizes attribute values, etc.
84 * Mutation events, when supported, are generated to reflect the changes occuring on the
85 * document.
86 * See Namespace normalization for details on how namespace declaration attributes and prefixes
87 * are normalized.
88 *
89 * NOTE: There is an initial support for DOM revalidation with XML Schema as a grammar.
90 * The tree might not be validated correctly if entityReferences, CDATA sections are
91 * present in the tree. The PSVI information is not exposed, normalized data (including element
92 * default content is not available).
93 *
94 * @xerces.experimental
95 *
96 * @author Elena Litani, IBM
97 * @author Neeraj Bajaj, Sun Microsystems, inc.
98 */
99 public class DOMNormalizer implements XMLDocumentHandler {
100
101 //
102 // constants
103 //
104 /** Debug normalize document*/
105 protected final static boolean DEBUG_ND = false;
106 /** Debug namespace fix up algorithm*/
107 protected final static boolean DEBUG = false;
108 /** Debug document handler events */
109 protected final static boolean DEBUG_EVENTS = false;
110
111 /** prefix added by namespace fixup algorithm should follow a pattern "NS" + index*/
112 protected final static String PREFIX = "NS";
113
114 //
115 // Data
116 //
117 protected DOMConfigurationImpl fConfiguration = null;
|