xml-crypto
xml-crypto copied to clipboard
defaultNs value when passed as option can't be used in exclusiveCanonicalization
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, '"');
}
What are you trying to accomplish @ponyesteves ? That might be a question that will get more responses.