A framework for state-based, logically-driven HTML structures