- From: James Fuller <jim@webcomposite.com>
- Date: Wed, 16 Mar 2016 18:39:33 +0100
- To: Alex Miłowski <alex@milowski.com>
- Cc: XProc WG <public-xml-processing-model-wg@w3.org>
live new version editing ---------------- xproc version = "2.0"; inputs: $source as document-node() outputs: $result as document-node() declare option p:exclude-inline-prefixes="my c p" declare option language declare option match declare option attr declare flow my:dyer inputs: $source as document-node() outputs: $result as document-node() ($langage as xs:string, $match as xs:string, $attr as xs:string, $lex as map:map ){ $source → replace($match) { [] → projection(template("/*/@{($attr)}")) ≫ $ca { if($lex($ca)) then xquery(template("attribute {($attr)} {( $lex($ca) )}") else $ca } ≫ [] } ≫ $result } p:load(href="{$language}.json",override-content-type="application/json")?colourMap ≫ $lexmap $source → my:dyer(match=$match,lex=$lexmap,attr=$attr) ≫ $result
Received on Wednesday, 16 March 2016 17:40:01 UTC