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 .text is 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> with strip=False).

  • Context collision, derivation-surfaced: <inputs> is element-only under <tool> but simpleContent under <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> (legacy xs: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).