@param base Parser-independent namespace definition.
(public parent: Namespace | ParserNamespace, config: ParserConfig)
| 9 | |
| 10 | /** @param base Parser-independent namespace definition. */ |
| 11 | constructor(public parent: Namespace | ParserNamespace, config: ParserConfig) { |
| 12 | if(parent instanceof ParserNamespace) { |
| 13 | this.base = parent.base; |
| 14 | this.native = parent.native.clone(); |
| 15 | |
| 16 | this.elementSet = new TokenSet(config.elementSpace, parent.elementSet); |
| 17 | this.attributeSet = new TokenSet(config.attributeSpace, parent.attributeSet); |
| 18 | } else { |
| 19 | this.base = parent; |
| 20 | this.native = new NativeNamespace(parent.uri); |
| 21 | |
| 22 | this.elementSet = new TokenSet(config.elementSpace); |
| 23 | this.attributeSet = new TokenSet(config.attributeSpace); |
| 24 | |
| 25 | this.attributeSet.addToken(config.xmlnsToken); |
| 26 | |
| 27 | for(let name of parent.elementNameList) { |
| 28 | this.addElement(name); |
| 29 | } |
| 30 | |
| 31 | for(let name of parent.attributeNameList) { |
| 32 | this.addAttribute(name); |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | registerNative(): NativeNamespace { |
| 38 | if(this.elementSet.dirty) { |
nothing calls this directly
no test coverage detected