[NTG-context] new xml feature (for html lovers)

Hans Hagen pragma at wxs.nl
Wed Dec 28 18:07:27 CET 2016


As a side effect of a fun project I've added css like selectors to the 
xml interface, so one can do:

\xmlall{#1}{{foo bar .whatever, bar foo .whatever}}


<?xml version="1.0" ?>

     <title    class="one">title 1</title>
     <subtitle class="sub">title 1.1</subtitle>
     <title    class="two">title 2</title>
     <subtitle class="sub">title 2.1</subtitle>
     <title    class="one">title 3</title>
     <subtitle class="sub">title 3.1</subtitle>
     <title    class="two">title 4</title>
     <subtitle class="sub">title 4.1</subtitle>


\startxmlsetups xml:selector:demo

   {{document title .one + subtitle, document title .two + subtitle}}


Performance should be ok although (currently) a combined selector 
triggers a result sorter which has a small speed penalty. After all you 
don't want your document to come out in the wrong order.

like things. In the process I optimized an aspect of the parser and 
hopefully I didn't break anything.


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl

More information about the ntg-context mailing list