TemplateParser: moved branch table detection outside of XSL parsing