xml-crypto icon indicating copy to clipboard operation
xml-crypto copied to clipboard

defaultNs value when passed as option can't be used in exclusiveCanonicalization

Open joeesteves opened this issue 9 years ago • 1 comments

Hi, i'm not sure the objective of defaultNs parameter here, cause it's value can't be used. In renderNs function the only use I see is to be compared with currNs . Am I missing something?

thanks

ExclusiveCanonicalization.prototype.renderNs = function(node, prefixesInScope, defaultNs, defaultNsForPrefix, inclusiveNamespacesPrefixList) {
  var a, i, p, attr
    , res = []
    , newDefaultNs = defaultNs
    , nsListToRender = []
    , currNs = node.namespaceURI || "";

  //handle the namespaceof the node itself
  if (node.prefix) {
    if (prefixesInScope.indexOf(node.prefix)==-1) {
      nsListToRender.push({"prefix": node.prefix, "namespaceURI": node.namespaceURI || defaultNsForPrefix[node.prefix]});
      prefixesInScope.push(node.prefix);
    }
  }
  else if (defaultNs!=currNs) {
      //new default ns
      newDefaultNs = node.namespaceURI;
      res.push(' xmlns="', newDefaultNs, '"');
  }

joeesteves avatar Aug 08 '16 19:08 joeesteves

What are you trying to accomplish @ponyesteves ? That might be a question that will get more responses.

cjbarth avatar May 29 '23 21:05 cjbarth