- From: Henry S. Thompson <ht@inf.ed.ac.uk>
- Date: Thu, 25 Feb 2016 09:12:28 +0000
- To: Alex Miłowski <alex@milowski.com>
- Cc: XProc WG <public-xml-processing-model-wg@w3.org>
Alex Miłowski writes: > Lacking a media type for mustache, expect this to work as: > > let $options := {"count" : count($source/*/para)} > data "text/plain" '{"numParas" : {{count}}}' -> x:mustache($options) > -> parse-json() Yes, but now you've given away comparability to XProc v.2 AVTs, in that all substitutions have to be serialised. That is, if you have variables whose values are JSON structures, you can't plug them in directly, you will have to serialise them yourself, or, build a version of mustache which does that for you. So we're back to a separate templating step for each media type, each with its own syntax, which is less than ideal, but probably unavoidable. ht -- Henry S. Thompson, School of Informatics, University of Edinburgh 10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail from me _always_ has a .sig like this -- mail without it is forged spam]
Received on Thursday, 25 February 2016 09:13:07 UTC