Skip to content

configure.php: recover failed XIncludes inside classsynopsis#326

Open
lacatoire wants to merge 2 commits into
php:masterfrom
lacatoire:fix/xinclude-fixup-classsynopsis
Open

configure.php: recover failed XIncludes inside classsynopsis#326
lacatoire wants to merge 2 commits into
php:masterfrom
lacatoire:fix/xinclude-fixup-classsynopsis

Conversation

@lacatoire

@lacatoire lacatoire commented Jul 23, 2026

Copy link
Copy Markdown
Member

xinclude_residual_fixup() recovers failed XIncludes on translations per
parent element, but had no classsynopsis case, so a failed include targeting
a methodsynopsis or fieldsynopsis inside a class synopsis hard-failed the
build (Unknown parent of failed XInclude: classsynopsis).

Adds a classsynopsis case injecting a <classsynopsisinfo role="comment">
marker, a valid child per the DocBook 5.2 RNG.

Related:

@alfsb

xinclude_residual_fixup handled listitem/refentry/refsect1/tbody/variablelist
parents but not classsynopsis, so a failed XInclude targeting a methodsynopsis
or fieldsynopsis inside a class synopsis hit the default branch and hard-failed
the build (Unknown parent of failed XInclude: classsynopsis).

Add a classsynopsis case that injects a <classsynopsisinfo role="comment">
carrying the failure marker. This is a valid child of classsynopsis per the
DocBook 5.2 RNG (verified), so translations with a missing class-member include
now surface the failure and keep validating, as intended for the other parents.
@alfsb

alfsb commented Jul 23, 2026

Copy link
Copy Markdown
Member

Got curious about the role="comment" part. I tested without the attribute (and after removing all `xi:fallback/locally), and it passes RNG 5.2.1 validation, on PHP 8.1.2-1ubuntu2.25, libxml 2.9.13. Checked the output to be sure that it was generated.

Does it break something locally, or does the missing attribute cause omitions/problems on the PhD side?

I prefer to keep fixups as minimal as possible. so no attribute or role='comment' (without the escape) is preferable. That said, it is a very ok change, that I may merge immediately.

Dropping the attribute passes RNG but PhD's format_classsynopsisinfo
(Generic/XHTML.php:1145) treats a role-less classsynopsisinfo as the
class-body opener: it appends ' {', sets classsynopsis close=true and
asserts legacy rendering. role='comment' renders the marker as '/* ... */'
instead, which is what the fixup needs.
@lacatoire

Copy link
Copy Markdown
Member Author

Good question. Dropping the attribute passes RNG, but it changes the PhD rendering. In format_classsynopsisinfo (Generic/XHTML.php:1145), a role-less classsynopsisinfo is treated as the class-body opener: it appends {, sets classsynopsis close=true and asserts legacy rendering. With the comment role the marker renders as /* ... */, which is what the fixup wants.

I've switched to single-quoted role='comment' to drop the escaping, as you suggested.

@alfsb

alfsb commented Jul 23, 2026

Copy link
Copy Markdown
Member

Nice. I really do not know these PhD specific behaviors.

Plan to merge this by monday, before any xi:fallback deletions.

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