GTR004 — Empty-element shorthand (fmt)
Contract: behaviour-preserving.
Claim
Collapsing a whitespace-only leaf to <foo/> is a no-op.
Proof
For an element-only/empty content model, ws-only
.textis layout (the GTR003 spec clause).The rule skips every schema-text-bearing element (the derived payload guard, fmt §D20 —
schema_content.text_bearing_tags()across all 28 XSDs): a ws-only body there may be verbatim payload (Galaxy reads<command>/<configfile>/<token>withstrip=False).Context collision, derivation-surfaced:
<inputs>is element-only under<tool>butsimpleContentunder<configfiles>(ConfigInputs) — payload only in the configfiles context (parent-tag check).
Proof-carried exceptions (still collapsed)
<help>: a whitespace-only help renders empty either way (fmt D18).<macros>(legacyxs:anyType): Galaxy’s loader harvests children then clears the element (galaxy/util/xml_macros.py:39-45) — its text is dead.
History
Refuted (content-bearing leaves) → denylist PR #113 → schema derivation fmt
§D20 (found the configfiles-<inputs> latent case).