-
Notifications
You must be signed in to change notification settings - Fork 74
MLE-26427 Initial exclusion support for XML #1879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Going to tackle error handling and unhappy path stuff next. More refactoring to be done as well.
|
Copyright Validation Results ✅ Valid Files
✅ All files have valid copyright headers! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces XML exclusion support for the IncrementalWriteFilter, extending the existing JSON exclusion functionality. The implementation allows users to specify XPath expressions to exclude specific XML elements from hash calculations during incremental writes.
Key changes:
- Added
xmlExclusionsparameter throughout the IncrementalWriteFilter class hierarchy - Implemented XML exclusion logic using XPath expressions in ContentExclusionUtil
- Refactored test structure by extracting common test setup into AbstractIncrementalWriteTest
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| IncrementalWriteTest.java | Refactored to extend AbstractIncrementalWriteTest and removed JSON exclusion test |
| ApplyExclusionsToIncrementalWriteTest.java | New test class containing both JSON and XML exclusion tests |
| AbstractIncrementalWriteTest.java | New base class providing shared test setup and utilities |
| DOMHandle.java | Updated to use centralized XmlFactories for XPath processor creation |
| XmlFactories.java | Added factory methods for XPathFactory and TransformerFactory |
| IncrementalWriteOpticFilter.java | Updated constructor to accept xmlExclusions parameter |
| IncrementalWriteFilter.java | Added xmlExclusions support and XML processing logic |
| IncrementalWriteEvalFilter.java | Updated constructor to accept xmlExclusions parameter |
| ContentExclusionUtil.java | Implemented XML exclusion functionality with XPath support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @return the modified XML content with specified elements removed | ||
| * @throws Exception if the XML content cannot be parsed or serialized | ||
| */ | ||
| static String applyXmlExclusions(String uri, String xmlContent, String... xpathExpressions) throws Exception { |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing generic Exception reduces clarity for API consumers. Consider creating a specific exception type or throwing more specific exceptions like XPathExpressionException or TransformerException to help callers handle errors appropriately.
Going to tackle error handling and unhappy path stuff next. More refactoring to be done as well.