For example, Cite would certainly need to be collecting all the <ref>
"placeholders" from the DOM, injecting ref numbers (and setting hrefs and ids if not whole new nodes) into them, and then producing some new
<ol>
and <li>
nodes (and nodes for the backlinks) to inject into the DOM for the
<references>
tag. It might even need to generate new DOM for error messages, like "reference Foo was used but never defined". What if some other extension wants to transform all the <ol>
, or collect all the anchors in the page, or all error messages, or something? If that extension's processor happens to run before Cite's, it wouldn't find the ones Cite adds.
And it's possible that Cite might want to be even smarter: if there's no <references>
tag, there's not much point in doing toDOM on the content of all the <ref>
s. Or if multiple <ref>
s collide, there's not much point in doing toDOM on both when only one will be used. So it might like to wait on doing the toDOM for each ref's contents until it knows that ref will actually be going into the page output. Is that allowed? Or does it have to do toDOM on all the refs' contents anyway even though some might be thrown away?