Binding values in Document Docextra

The extension point Document Docextra (org.xwiki.plaftorm.template.docextra) adds a new tab to the document.
But what about the binding of document variables?

E.g. $doc is available

but variables set within the document (by macros etc.) like

{{velocity}}
#set ($myvar="value")
{{/velocity}}

are not.

It seems that the tab is rendered before the document or it is executed in a separated execution context.

Can the sequence or the context be controlled?

Thanks for help

Norbert

(XWiki: 13.10.3)