Skip to content

Make C14nCanonicalization renderNs() and processInner() private, and drop the prefix-name scope check #618

Description

@cjbarth

#615 fixes inclusive c14n by tracking each in-scope prefix together with its namespace URI. C14nCanonicalization is exported, so renderNs() and processInner() are part of the published types, even though renderNs() is documented @api private. To stay within 6.x semver, #615 kept both signatures and added an optional last parameter, namespacesInScope. process() always passes it.

A caller or subclass that passes only the original arguments falls back to the old prefix-name check, prefixesInScope.indexOf(prefix) !== -1. That check is the #614 bug: it drops a declaration that rebinds an in-scope prefix. It stays only so that 6.x callers see no change.

In 7.0

  • Make renderNs() and processInner() private.
  • Drop prefixesInScope: string[] and the fallback check, so namespacesInScope is the only scope.

A search of public code while reviewing #615 found no callers or subclasses of either method, only forks and vendored copies. GitHub code search covers only the default branches of public repositories.

ExclusiveCanonicalization has the same public renderNs() and processInner(). Making them private at the same time would keep the two classes consistent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions