MCPcopy Create free account
hub / github.com/NaturalIntelligence/fast-xml-parser / resolveNameSpace

Function resolveNameSpace

src/xmlparser/OrderedObjParser.js:183–195  ·  view source on GitHub ↗
(tagname)

Source from the content-addressed store, hash-verified

181}
182
183function resolveNameSpace(tagname) {
184 if (this.options.removeNSPrefix) {
185 const tags = tagname.split(':');
186 const prefix = tagname.charAt(0) === '/' ? '/' : '';
187 if (tags[0] === 'xmlns') {
188 return '';
189 }
190 if (tags.length === 2) {
191 tagname = prefix + tags[1];
192 }
193 }
194 return tagname;
195}
196
197//TODO: change regex to capture NS
198//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected