Discussion split from T151305#5723309 and following.
Should we allow subreferences to be declared inside the references section?
This is difficult on a technical level, because this case cannot be detected early enough to do footnote numbering correctly. See parser test "Extends <ref> defined in <references> called with #tag", and this example:
<ref name="child" /> <references> <ref name="parent">All about a book.</ref> <ref name="child" extends="parent">page 10</ref> </references>
If this will be allowed, we need to figure out how to support it and possibly require a weird syntax like <ref name="child" extends="parent />. If not, then we should display an error.