Dear list,

I have the following sample:

  \startbuffer[demo]
  <html>
    <body>
      <div id="First">
        <p>This is
          <span class="special">One of the best</span> a paragraph.</p>
        <p>This is another paragraph.</p>
        <p>This is another
          <span class="special">Two of the best</span> paragraph.</p>
        <p>This is another
          <span class="special">Three</span> paragraph.</p>
        <p>This is another
          <span class="special">Four of five</span> paragraph.</p>
      </div>
    </body>
  </html>
  \stopbuffer

  \startxmlsetups xml:initialize
    \xmlsetsetup{#1}{html}{xml:gen}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:gen
     \xmlfilter{#1}{/**/div/command(xml:special)}
  \stopxmlsetups

  \startxmlsetups xml:special
    %~ \startitem
    \cldcontext{string.gsub(lxml.flush([[#1]]),
       " of the ", "")}\stopitem
  \stopxmlsetups

  \starttext
    \xmlprocessbuffer{main}{demo}{}
  \stoptext

Is there any way to remove " of " and " of the " in the filtered content
(xml:special)?

Sorry, Lua code is crap for sure.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to