xmlsquishsource. compose. build.
中文

XML DSL & project guide

Match strings without leaking scope

xs:ifr provides regular-expression matching and lexical named captures. Scalar and XML content remain separate throughout evaluation.

Jump to a chapter
On this page

Conditional matching

A failed match emits nothing. A successful match exposes match.* captures inside the xs:ifr body only; sibling blocks cannot observe them.

<xs:ifr get="arg.value" pattern="^(?&lt;head&gt;.)(?&lt;tail&gt;.*)$">
  <xs:insert get="match.head"/>
</xs:ifr>

Three read-only binding domains

file.*

Information about the macro definition source.

arg.*

Strings explicitly passed to this invocation.

match.*

Named captures in the current ifr lexical block.

Output is always escaped

Use xs:insert to emit a scalar as escaped text. It never reparses <, >, or & as markup. Use xs:fill/xs:slot when structure must remain XML.