It is easy to mix different methods to define HTML headers in PD4ML.
So first please take a look to the following topic:
In the code
<%=myVar%> will be substituted with myVar value before the document is passed to PD4ML. So from PD4ML perspective it is going to be a static text (value). The only variable dynamically changes its value from page to page is $[page]
To define different headers for different pages you need to do something like that: