XSLT element “scheme:init” works

I'm working on embedding Guile (Scheme interpreter) to xsltproc. I've introduced the element "init" to contain Scheme initialization code and added (I suppose, sometimes redundant) error checks. Well, it works now:

<x:stylesheet
  xmlns:x = "http://www.w3.org/1999/XSL/Transform"
  xmlns:s = "http://uucode.com/xslt/scheme"
  x:extension-element-prefixes="s"
  version = "1.0">

<s:init>
  (display "SCHEME: Initialization")
  (define greeting "SCHEME: Hello from scheme.xsl!")
  (newline)
</s:init>

<x:template match="/">
  <x>
    <s:scheme>
      (display greeting)
      (newline)
    </s:scheme>
  </x>
</x:template>

</x:stylesheet>

Vibe code with your voice

Stop fighting speech recognition.
Just talk → fix mistakes later

"... _brings_ hello world"   ❌
          ↓
"... _prints_ hello world"   ✅

Get handsfree.vc on Google Play

Categories: Generative XML

Updated: