xproc / Vnext

Assembly point for all issues for a next version of XProc
1 stars 0 forks source link

TVT expansion in comments and processing instructions? #2

Open xatapult opened 4 years ago

xatapult commented 4 years ago

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:

gimsieke commented 4 years ago

I think this is because XSLT doesn’t have comment/PI value templates, either. It will be interesting to know whether the XSLT WG discussed the question.

The implementers might weigh in their thoughts or just shout “feature freeze”.

xml-project commented 4 years ago

FeATuRE FrEeZe!

Serious: It's an interesting point, but because XSLT does not have it, users will not expect this. Defer to 3.1?

xatapult commented 4 years ago

Fine with me, just asking... 😬

I completely go with the feature freeze. There's always a way around this by doing an XSLT or XQuery step if you need this.