xmlsquishsource. compose. build.
中文

XML DSL & project guide

Separate products from libraries

An entry builds a prompt; pack delivers entries and assets; SOPack distributes a compiled library. A module publishes macros. Imports make module definitions visible without executing them.

Jump to a chapter
On this page

Four source roots

xs:module may contain imports and macros only. xs:entry has declarations followed by an output-producing body; an entry cannot be imported.

xs:entry

Accepts declarations, then constructs the final document.

xs:module

Registers definitions but has no executable body.

xs:pack

Collects compiled entry products and complete asset bytes into a reproducible ZIP .pack.

xs:sopack

Preserves IR, compiled modules, macros, assets and metadata, without final products.

Define a module

<xs:module xmlns:xs="https://xmlsquish.moesegfault.dev/ns"
           xmlns:app="urn:example:app">
  <xs:macro name="app:greeting">
    <xs:param name="name"/>
    <Hello><xs:insert get="arg.name"/></Hello>
  </xs:macro>
</xs:module>

Import from the entry

Relative import paths are resolved from the file that declares them. The manager loads each source identity once and freezes the import closure before expansion.

<xs:entry xmlns:xs="https://xmlsquish.moesegfault.dev/ns"
          xmlns:app="urn:example:app">
  <xs:import src="./macros.xml"/>
  <xs:expand ref="app:greeting">
    <xs:arg name="name" value="Klee"/>
  </xs:expand>
</xs:entry>