Migrate XDoc generator from XMLWriter to Doxia Sink API #519
+144
−154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes the XDoc generator to use the Doxia Sink API instead of manually generating XDoc XML with XMLWriter, aligning with the approach used in other Maven plugins (similar to MPLUGIN-442).
Changes
Core Migration
XMLWriter
andPrettyPrintXMLWriter
with DoxiaSink
API throughoutXdocGenerator
head()
,body()
,section1()
,table()
, etc.) instead of manual XML element writingplexus-utils
XMLWriter classesdoxia-sink-api
anddoxia-module-xdoc
(version 2.0.0)Output Format Upgrade
The generator now produces XDoc 2.0 format instead of XDoc 1.0:
xmlns="http://maven.apache.org/XDOC/2.0"
)<a id="...">
instead of<a name="...">
for anchors (XDoc 2.0 standard)Technical Details
table()
doesn't output the opening<table>
tag - usesrawText()
to inject tags manuallyBenefits
Testing
All existing tests pass with updated expectations:
testXdocGenerator
- validates generated structure and internal linkstestHtmlToXml
- validates HTML to XDoc conversionFixes #123
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.