MCPcopy Create free account
hub / github.com/charto/cxml / bindNamespace

Method bindNamespace

src/parser/ParserConfig.ts:180–194  ·  view source on GitHub ↗
(nsBase: Namespace, prefix?: string, parser?: Parser)

Source from the content-addressed store, hash-verified

178 }
179
180 bindNamespace(nsBase: Namespace, prefix?: string, parser?: Parser) {
181 this.addNamespace(nsBase);
182
183 let uri = (this.nsMapper && this.nsMapper(nsBase.uri)) || nsBase.uri;
184 let nsParser = this.namespaceTbl[uri];
185
186 if(!prefix && prefix != '') prefix = nsParser.base.defaultPrefix;
187
188 (parser || this).bindPrefix(
189 this.addPrefix(prefix),
190 this.addUri(uri, nsParser)
191 );
192
193 return(nsParser.id);
194 }
195
196 updateNamespaces() {
197 const list = this.namespaceList;

Callers 2

constructorMethod · 0.95
parseCodeBufferMethod · 0.80

Calls 4

addNamespaceMethod · 0.95
addPrefixMethod · 0.95
addUriMethod · 0.95
bindPrefixMethod · 0.45

Tested by

no test coverage detected