I have been developing large scale HTML publishing.
Usually map and topics are processed separately, but we need the information that can be obtained from map or some HTML output that is composed from multiple topics.
As a result, I built merged middle file (usually used for PDF output) and used it to reflect map information to topic.
In the merged middle file processing, we must walk through from map root to end and reference the topics that is written in topicref/@href.
I recommend merged middle file architecture.
Regards,