Lines Matching refs:prefix

37      * unique prefix.
91 return ""; // can use the default prefix. use it whenever we can
93 // find a valid prefix for this namespace URI
106 String prefix = (String)reverseDecls.get(namespaceUri);
107 if( prefix!=null ) {
108 if( !requirePrefix || prefix.length()!=0 ) {
111 return prefix;
113 // the prefix was already allocated but it's "",
114 // and we specifically need non-empty prefix.
117 decls.remove(prefix);
124 // the empty namespace URI needs to be bound to the default prefix.
125 prefix = "";
128 prefix = nss.getPrefix(namespaceUri);
129 if( prefix==null )
130 prefix = (String)reverseDecls.get(namespaceUri);
132 if( prefix==null ) {
136 // prefixMapper decide if it wants to use the suggested prefix.
137 // otherwise our best bet is the suggested prefix.
139 prefix = prefixMapper.getPreferredPrefix(
142 prefix = preferedPrefix;
144 if( prefix==null )
146 prefix = "ns"+(iota++);
150 // ASSERT: prefix!=null
152 if( requirePrefix && prefix.length()==0 )
153 // we can't map it to the default prefix. generate one.
154 prefix = "ns"+(iota++);
158 String existingUri = (String)decls.get(prefix);
161 // this prefix is unoccupied. use it
162 decls.put( prefix, namespaceUri );
163 reverseDecls.put( namespaceUri, prefix );
164 return prefix;
169 // prefix because the current association of ""->"" cannot
178 decls.put( prefix, namespaceUri );
179 reverseDecls.put( namespaceUri, prefix );
184 // we need to find a new prefix for URI "namespaceUri"
185 // generate a machine-made prefix
186 prefix = "ns"+(iota++);
198 // the only time a prefix is required is when we print
201 // assume that we don't require a prefix in this case.
206 * Obtains the namespace URI currently associated to the given prefix.
209 public String getNamespaceURI( String prefix ) {
210 String uri = (String)decls.get(prefix);
213 return nss.getURI(prefix);
220 String prefix = (String)reverseDecls.get(namespaceUri);
221 if(prefix!=null) s.add(prefix);
244 * Reconciles the namespace URI/prefix mapping requests since the
256 String prefix = (String)e.getKey();
258 if(!uri.equals(nss.getURI(prefix))) // avoid redundant decls.
259 nss.declarePrefix( prefix, uri );