(#17183) Pass on parameters to recursive children in static_compiler

Pass on parameters from the top level resource to recursive children in
the static compiler.
The list of parameters to exclude is taken from the file type
implementation.
Merge pull request #1609 from dalen/17183_static_compiler_recursive_copy

(#17183) Pass on parameters to recursive children in static_compiler