Lines Matching refs:prefix

34  * prefix/uri/depth triplets are pushed on a stack pushed on a stack. The depth
49 * When the <chapter> element is encounted the prefix "p1" associated with uri
58 * So prefix/uri pairs are pushed and poped off the stack as elements are
60 * are on the stack and a prefix can be found given a uri, or a uri can be found
61 * given a prefix.
76 * Each entry (prefix) in this hashmap points to a Stack of URIs
77 * This maps a prefix (String) to a Stack of prefix mappings.
78 * All mappings in that retrieved stack have the same prefix,
88 * Used to know how many prefix mappings to pop when leaving
90 * For every prefix mapping the current element depth is
94 * Used to ensure prefix/uri map scopes are closed correctly
113 * and predefines a few prefix/uri pairs which always exist.
133 * Use a namespace prefix to lookup a namespace URI.
135 * @param prefix String the prefix of the namespace
136 * @return the URI corresponding to the prefix
138 public String lookupNamespace(String prefix)
140 final Stack stack = (Stack) m_namespaces.get(prefix);
145 MappingRecord getMappingFromPrefix(String prefix) {
146 final Stack stack = (Stack) m_namespaces.get(prefix);
153 * current element, return the current prefix for that uri.
156 * @return an existing prefix that maps to the given URI, null if no prefix
164 String prefix = itr.next();
165 String uri2 = lookupNamespace(prefix);
168 foundPrefix = prefix;
181 String prefix = itr.next();
182 MappingRecord map2 = getMappingFromPrefix(prefix);
193 * Undeclare the namespace that is currently pointed to by a given prefix
195 boolean popNamespace(String prefix)
198 if (prefix.startsWith(XML_PREFIX))
204 if ((stack = (Stack) m_namespaces.get(prefix)) != null)
213 * Declare a mapping of a prefix to namespace URI at the given element depth.
214 * @param prefix a String with the prefix for a qualified name
215 * @param uri a String with the uri to which the prefix is to map
218 boolean pushNamespace(String prefix, String uri, int elemDepth)
221 if (prefix.startsWith(XML_PREFIX))
227 // Get the stack that contains URIs for the specified prefix
228 if ((stack = (Stack) m_namespaces.get(prefix)) == null)
230 m_namespaces.put(prefix, stack = new Stack());
237 MappingRecord map = new MappingRecord(prefix,uri,elemDepth);
266 final String prefix = map.m_prefix;
267 popNamespace(prefix);
272 saxHandler.endPrefixMapping(prefix);
284 * Generate a new namespace prefix ( ns0, ns1 ...) not used before
285 * @return String a new namespace prefix ( ns0, ns1, ns2 ...)
315 final String m_prefix; // the prefix
319 MappingRecord(String prefix, String uri, int depth) {
320 m_prefix = prefix;