The spec now specifies TVT curly-braced expressions in text nodes only: https://spec.xproc.org/master/head/xproc/#text-value-templates
I recently stumbled upon a use-case where I wanted to construct a comment node using a TVT but that (correct) does not work:
<p:variable name="x" select="'something for a comment...'"/>
<p:identity>
<p:with-input port="source">
<p:inline>
<!-- {$x} -->
</p:inline>
</p:with-input>
</p:identity>
The same is true for TVT expansion in processing instructions. I think there's a clear use-case for that: What if you want to build a PI that defines schema validation and have the path to the schema from somewhere else, in a variable or something like that?
So:
- What was the reason (if any) to limit TVT expansion to text nodes?
- Is it worth it to revise this decision and do TVT expansion in comment nodes and PIs also|?
The spec now specifies TVT curly-braced expressions in text nodes only: https://spec.xproc.org/master/head/xproc/#text-value-templates
I recently stumbled upon a use-case where I wanted to construct a comment node using a TVT but that (correct) does not work:
The same is true for TVT expansion in processing instructions. I think there's a clear use-case for that: What if you want to build a PI that defines schema validation and have the path to the schema from somewhere else, in a variable or something like that?
So: