Skip to content

Conversation

@kostadinSpiridonov
Copy link

Added on transform action in the HTML to WML converter. It provides a way for injecting a custom logic for the transformation via the settings object.

huan086 pushed a commit to huan086/Open-Xml-PowerTools that referenced this pull request Sep 17, 2024
* Enabled building & testing with ubuntu
* Cleaned up code
knilecrack added a commit to knilecrack/Open-Xml-PowerTools that referenced this pull request Jan 28, 2026
…mparer

This commit addresses two issues:

1. XDocument Mutation (Issue OpenXmlDev#3):
   - WmlDocument.MainDocumentPart and PtMainDocumentPart.WordprocessingCommentsPart
     were removing nodes from cached XDocuments, causing subsequent GetXDocument()
     calls to return empty documents within the same package lifetime
   - Fixed by cloning the root element before extracting and removing child nodes
   - Location: WmlDocument.cs lines 67-81 and 20-37

2. Duplicate Singleton Relationships:
   - WmlComparer.MoveRelatedPartsToDestination was creating duplicate relationships
     for singleton parts (fontTable, styles, numbering, settings, webSettings, theme)
   - This caused validation errors: "can only have one instance of relationship
     that targets part fontTable"
   - Fixed by checking if a singleton relationship already exists and reusing it
     instead of creating a duplicate
   - Location: WmlComparer.cs MoveRelatedPartsToDestination method

Test Results:
- Fixed 2 WmlComparer tests (RC-0020, WCB-1740) that were failing with fontTable errors
- Improved from 22 failing tests to 20 failing tests (956 -> 958 passing)
- Remaining failures are unrelated to these issues

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
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.

1 participant