Skip to content

Conversation

@shunkica
Copy link
Contributor

There is still a lot of work to do here but I wanted to gauge your opinion before proceeding any further.
In particular because of the changes that I made to existing code, interaction with the existing code (particulary regarding disposables), and the bindings that were added.

Furthermore I don't really know how to get around the unsupported node types when used with NodeSet canonicalization and createNode in isVisibleCallback.

The changes needed for just the plain Document canonicalization, and Node canonicalization are minimal. Most of the changes were needed to accommodate the NodeSet canonicalization and the callback canonicalization, so it is probably worth considering if those are even needed.

@shunkica
Copy link
Contributor Author

@jameslan this is still a WIP but let me know what you think about the changes

@shunkica shunkica marked this pull request as ready for review November 13, 2025 11:05
@shunkica shunkica changed the title wip: add support for C14N Add support for C14N Nov 13, 2025
- Replace xmlC14NDocDumpMemory with xmlC14NExecute + xmlOutputBufferCreateIO
- Remove document cloning workaround (xmlCopyNode, xmlNewDoc) by implementing proper node-level canonicalization
- Add canonicalize() and canonicalizeToString() methods to both XmlDocument and XmlNode classes
- Introduce XmlC14NIsVisibleCallback type for custom node filtering during canonicalization
- Update C14NOptions interface with better type definitions and documentation
- Remove obsolete utility classes (XmlNodeSetWrapper) and simplify memory management
- Expand test coverage with comprehensive tests for all C14N modes, node-level canonicalization, comments handling, and inclusive namespaces
…nt/node methods, adjust memory handling and callbacks
@github-actions
Copy link

Coverage after merging c14n into master will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   c14n.mts100%100%100%100%
   diag.mts99.51%100%90.91%100%
   disposable.mts100%100%100%100%
   disposeShim.mts100%100%100%100%
   document.mts100%100%100%100%
   dtd.mts100%100%100%100%
   index.mts100%100%100%100%
   libxml2.mts100%100%100%100%
   metadataShim.mts100%100%100%100%
   nodejs.mts100%100%100%100%
   nodes.mts100%100%100%100%
   utils.mts100%100%100%100%
   validates.mts100%100%100%100%
   xpath.mts100%100%100%100%

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants