<?xml version="1.0" encoding="UTF-8"?>
<xao-docs>
  <site name="XaoDocs" product="Xao" version="1.0.0-dev" homepage="https://xao.ndx.au" repo="https://github.com/ndx-au/Xao" examples-repo="https://github.com/ndx-au/xao-example-apps"/>
  <request slug="xslt-themes" theme="atlas" path="/xml/xslt-themes" xml-url="/xml/xslt-themes"/>
  <themes>
    <theme id="atlas" name="Atlas" tagline="Three-column reference desk with persistent sidebar and sticky page outline" audience="API and framework developers browsing across sections" structure="3-column grid: left navigation sidebar, center article, right on-this-page outline" css="/assets/atlas.css" active="true"/>
    <theme id="folio" name="Folio" tagline="Editorial journal spread with XPath-grouped numbered chapters and collapsible library" audience="Architects and evaluators reading long-form conceptual chapters" structure="Editorial cover header, collapsible library drawer, and sibling-grouped numbered chapter sections" css="/assets/folio.css" active="false"/>
    <theme id="console" name="Console" tagline="Operations dashboard with telemetry strip and collapsible H2 module accordions" audience="SREs, operators, and runtime engineers scanning sections quickly" structure="Command header, telemetry bar, compact nav rail, and expandable &lt;details&gt; module accordions" css="/assets/console.css" active="false"/>
    <theme id="reader" name="Reader (A11y)" tagline="WCAG AAA single-column linear reader with upfront summary, numbered TOC, and zero JS" audience="Screen reader users, keyboard-only navigation, and low-vision / cognitive accessibility" structure="Multi-landmark skip links, upfront document summary, inline numbered TOC, figure-wrapped code blocks, directory after article, zero JS" css="/assets/reader.css" active="false"/>
    <theme id="handbook" name="Handbook" tagline="Single-column print-ready technical specification sheet with metadata ledger" audience="Technical reviewers, auditors, and print/PDF export workflows" structure="Single-column specification document with &lt;dl&gt; metadata ledger, numbered outline, and print stylesheet" css="/assets/handbook.css" active="false"/>
  </themes>
  <navigation>
    <section name="Start Here">
      <item slug="index" title="Xao Documentation" description="XML Application Objects for PHP 8 and PHC — zero-dependency XML content aggregation and XSLT 3.0 presentation." order="1" active="false"/>
      <item slug="getting-started" title="Getting Started" description="Set up PHC, autoload Xao with zero Composer packages, transform your first DomDoc with XSLT 3.0, and run phc serve." order="2" active="false"/>
    </section>
    <section name="Core Concepts">
      <item slug="architecture" title="Architecture &amp; XML Aggregation" description="How Xao builds a unified XML conglomeration document from databases, Markdown, and domain objects before delegating presentation to XSLT 3.0." order="3" active="false"/>
      <item slug="xslt-themes" title="XSLT 3.0 Themes vs CSS Skins" description="Why XSLT themes are structurally and semantically richer than CSS-only themes — including accessibility-first DOM transformations." order="4" active="true"/>
    </section>
    <section name="Framework Reference">
      <item slug="core-api" title="Core API Reference" description="Reference for Xao\\Runtime, Xao\\XaoRoot, Xao\\DomDoc, Xao\\DomFactory, Xao\\AppDoc, Xao\\Http\\Response, and Xao\\Exceptions." order="5" active="false"/>
      <item slug="database-aggregation" title="Database Aggregation (DbToXml)" description="Convert PDO queries, PDOStatement results, and PHP iterables directly into structured DomDoc XML fragments under PHC." order="6" active="false"/>
      <item slug="markdown-aggregation" title="Markdown Aggregation" description="Convert CommonMark and GFM into CommonMark XML 1.0 natively in PHC via comrak and graft it into Xao DomDoc trees." order="7" active="false"/>
      <item slug="xslt-drivers" title="XSLT 3.0 Drivers" description="Pluggable XsltDriverInterface strategies: PhcNativeXsltDriver (default in-process), SaxonHttpDriver (HTTP/distributed), and ClientSideXslDriver." order="8" active="false"/>
    </section>
    <section name="Operations &amp; Runtime">
      <item slug="phc-runtime" title="PHC Runtime &amp; Compatibility" description="Running Xao on PHC in isolate and worker modes, sandbox defaults, worker-safe autoloading, and P00–P05 compatibility findings." order="9" active="false"/>
      <item slug="security" title="Security Model" description="XXE rejection, realpath containment, strict slug allowlists, CSRF guards, gated debug output, and PHC sandbox enforcement." order="10" active="false"/>
    </section>
    <section name="Examples &amp; Design">
      <item slug="reference-apps" title="Reference Applications" description="Comparing Xao's built-in SQLite PDO catalog reference app with XaoDocs, the flat-file Markdown multi-theme CMS." order="11" active="false"/>
      <item slug="adr-0001-phc-xee-xslt" title="ADR 0001 &amp; Roadmap" description="Architecture Decision Record for pure-Rust xee-xslt in PHC plus the Xao v1.0.0 milestone and phase roadmap (M0–M3, P00–P06)." order="12" active="false"/>
    </section>
  </navigation>
  <page slug="xslt-themes" title="XSLT 3.0 Themes vs CSS Skins" description="Why XSLT themes are structurally and semantically richer than CSS-only themes — including accessibility-first DOM transformations." section="Core Concepts" audience="Designers, accessibility engineers, and CMS builders" status="stable" words="444" reading-minutes="3" source-file="content/xslt-themes.md">
    <tags>
      <tag>xslt3</tag>
      <tag>themes</tag>
      <tag>accessibility</tag>
      <tag>xee-xslt</tag>
    </tags>
    <neighbors>
      <prev slug="architecture" title="Architecture &amp; XML Aggregation"/>
      <next slug="core-api" title="Core API Reference"/>
    </neighbors>
    <body>
      <document xmlns="http://commonmark.org/xml/1.0">
        <heading level="1">
          <text xml:space="preserve">XSLT 3.0 Themes vs CSS Skins</text>
        </heading>
        <paragraph>
          <text xml:space="preserve">Most modern web frameworks treat "theming" as swapping CSS variables, colors, and fonts while keeping the HTML DOM fixed. That works for cosmetic branding, but breaks down as soon as different audiences need </text>
          <strong>
            <text xml:space="preserve">different document structure, reading order, or assistive landmarks</text>
          </strong>
          <text xml:space="preserve">.</text>
        </paragraph>
        <paragraph>
          <text xml:space="preserve">With XSLT 3.0, </text>
          <strong>
            <text xml:space="preserve">every theme is a structural transformation</text>
          </strong>
          <text xml:space="preserve"> from one semantic XML source tree into an arbitrary target HTML DOM.</text>
        </paragraph>
        <heading level="2">
          <text xml:space="preserve">Five Themes, One XML Tree</text>
        </heading>
        <paragraph>
          <text xml:space="preserve">In XaoDocs, every documentation page produces the exact same </text>
          <code xml:space="preserve">&lt;xao-docs&gt;</code>
          <text xml:space="preserve"> XML conglomeration (inspectable at </text>
          <code xml:space="preserve">/xml/{slug}</code>
          <text xml:space="preserve">), then routes it through one of five independent XSLT 3.0 theme collections:</text>
        </paragraph>
        <table>
          <table_header>
            <table_cell>
              <text xml:space="preserve">Theme</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Primary Audience</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Structural Transformation (Not Just CSS)</text>
            </table_cell>
          </table_header>
          <table_row>
            <table_cell>
              <strong>
                <text xml:space="preserve">Atlas</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">?theme=atlas</code>
              <text xml:space="preserve">)</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Framework developers</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">3-column grid: left categorized nav sidebar, center article, right sticky "On this page" outline</text>
            </table_cell>
          </table_row>
          <table_row>
            <table_cell>
              <strong>
                <text xml:space="preserve">Folio</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">?theme=folio</code>
              <text xml:space="preserve">)</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Architects &amp; evaluators</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Editorial cover spread, collapsible library </text>
              <code xml:space="preserve">&lt;details&gt;</code>
              <text xml:space="preserve">, and XPath 3.1 sibling-grouped numbered chapters</text>
            </table_cell>
          </table_row>
          <table_row>
            <table_cell>
              <strong>
                <text xml:space="preserve">Console</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">?theme=console</code>
              <text xml:space="preserve">)</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Operators &amp; SREs</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Telemetry strip (</text>
              <code xml:space="preserve">slug</code>
              <text xml:space="preserve">, </text>
              <code xml:space="preserve">words</code>
              <text xml:space="preserve">, </text>
              <code xml:space="preserve">reading-minutes</code>
              <text xml:space="preserve">, </text>
              <code xml:space="preserve">phc/xsl3</code>
              <text xml:space="preserve">), nav rail, and collapsible </text>
              <code xml:space="preserve">&lt;details&gt;</code>
              <text xml:space="preserve"> H2 modules</text>
            </table_cell>
          </table_row>
          <table_row>
            <table_cell>
              <strong>
                <text xml:space="preserve">Reader</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">?theme=reader</code>
              <text xml:space="preserve">)</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Screen-reader &amp; low-vision users</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Upfront Document Summary, inline numbered TOC, </text>
              <code xml:space="preserve">&lt;figure&gt;&lt;figcaption&gt;</code>
              <text xml:space="preserve"> code wrappers, directory after article, </text>
              <strong>
                <text xml:space="preserve">zero JS</text>
              </strong>
            </table_cell>
          </table_row>
          <table_row>
            <table_cell>
              <strong>
                <text xml:space="preserve">Handbook</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">?theme=handbook</code>
              <text xml:space="preserve">)</text>
            </table_cell>
            <table_cell>
              <text xml:space="preserve">Technical auditors &amp; print</text>
            </table_cell>
            <table_cell>
              <code xml:space="preserve">&lt;dl class="spec-meta"&gt;</code>
              <text xml:space="preserve"> specification ledger, numbered section index, </text>
              <code xml:space="preserve">@media print</code>
              <text xml:space="preserve"> page layout</text>
            </table_cell>
          </table_row>
        </table>
        <heading level="2">
          <text xml:space="preserve">How Accessibility Benefits From XSLT</text>
        </heading>
        <paragraph>
          <text xml:space="preserve">Consider the </text>
          <strong>
            <text xml:space="preserve">Reader</text>
          </strong>
          <text xml:space="preserve"> theme (</text>
          <code xml:space="preserve">themes/reader/page.xsl</code>
          <text xml:space="preserve">):</text>
        </paragraph>
        <list type="bullet" tight="true">
          <item>
            <paragraph>
              <strong>
                <text xml:space="preserve">Reading order matters for screen readers:</text>
              </strong>
              <text xml:space="preserve"> Sidebars placed before </text>
              <code xml:space="preserve">&lt;main&gt;</code>
              <text xml:space="preserve"> force keyboard and screen-reader users to tab past dozens of navigation links before discovering what a page is about. In </text>
              <strong>
                <text xml:space="preserve">Reader</text>
              </strong>
              <text xml:space="preserve">, XSLT reorders the DOM completely: skip landmarks first, an explicit </text>
              <strong>
                <text xml:space="preserve">Document Summary</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">id="doc-summary"</code>
              <text xml:space="preserve">) second, a numbered </text>
              <strong>
                <text xml:space="preserve">Table of Contents</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">id="doc-toc"</code>
              <text xml:space="preserve">) third, the article body fourth, and the full </text>
              <strong>
                <text xml:space="preserve">Site Directory</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">id="site-directory"</code>
              <text xml:space="preserve">) </text>
              <emph>
                <text xml:space="preserve">after</text>
              </emph>
              <text xml:space="preserve"> the article.</text>
            </paragraph>
          </item>
          <item>
            <paragraph>
              <strong>
                <text xml:space="preserve">Template overrides for richer semantics:</text>
              </strong>
              <text xml:space="preserve"> </text>
              <code xml:space="preserve">themes/reader/page.xsl</code>
              <text xml:space="preserve"> includes </text>
              <code xml:space="preserve">themes/shared/commonmark.xsl</code>
              <text xml:space="preserve"> and overrides </text>
              <code xml:space="preserve">cm:code_block</code>
              <text xml:space="preserve"> with </text>
              <code xml:space="preserve">priority="2"</code>
              <text xml:space="preserve"> to wrap every code block in </text>
              <code xml:space="preserve">&lt;figure class="code-figure"&gt;&lt;figcaption&gt;Code example (...)&lt;/figcaption&gt;...&lt;/figure&gt;</code>
              <text xml:space="preserve">, giving assistive technologies explicit context for every code listing.</text>
            </paragraph>
          </item>
          <item>
            <paragraph>
              <strong>
                <text xml:space="preserve">Zero JavaScript:</text>
              </strong>
              <text xml:space="preserve"> Unlike themes that need scripts for accordions or dynamic outlines, </text>
              <strong>
                <text xml:space="preserve">Reader</text>
              </strong>
              <text xml:space="preserve"> emits 100% self-contained static semantic HTML.</text>
            </paragraph>
          </item>
        </list>
        <heading level="2">
          <text xml:space="preserve">Shared Templates &amp; </text>
          <code xml:space="preserve">xee-xslt</code>
          <text xml:space="preserve"> Patterns</text>
        </heading>
        <paragraph>
          <text xml:space="preserve">XaoDocs' themes share Markdown element rendering via </text>
          <code xml:space="preserve">&lt;xsl:include href="../shared/commonmark.xsl"/&gt;</code>
          <text xml:space="preserve"> and navigation partials via </text>
          <code xml:space="preserve">&lt;xsl:include href="../shared/partials.xsl"/&gt;</code>
          <text xml:space="preserve">.</text>
        </paragraph>
        <paragraph>
          <text xml:space="preserve">Under PHC's </text>
          <code xml:space="preserve">xee-xslt</code>
          <text xml:space="preserve"> engine, XaoDocs uses:</text>
        </paragraph>
        <list type="bullet" tight="true">
          <item>
            <paragraph>
              <strong>
                <text xml:space="preserve">Named modes</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">&lt;xsl:apply-templates select="." mode="theme-switcher"/&gt;</code>
              <text xml:space="preserve">) for reusable layout partials.</text>
            </paragraph>
          </item>
          <item>
            <paragraph>
              <strong>
                <text xml:space="preserve">XPath 3.1 sibling grouping</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">following-sibling::*[preceding-sibling::cm:heading[@level='2'][1] is $h][not(self::cm:heading[@level='2'])]</code>
              <text xml:space="preserve">) to group flat CommonMark </text>
              <code xml:space="preserve">cm:heading[@level='2']</code>
              <text xml:space="preserve"> siblings into Folio chapters and Console accordion modules.</text>
            </paragraph>
          </item>
          <item>
            <paragraph>
              <strong>
                <text xml:space="preserve">Text value templates</text>
              </strong>
              <text xml:space="preserve"> (</text>
              <code xml:space="preserve">expand-text="yes"</code>
              <text xml:space="preserve">) and XPath 3.1 functions (</text>
              <code xml:space="preserve">replace()</code>
              <text xml:space="preserve">, </text>
              <code xml:space="preserve">lower-case()</code>
              <text xml:space="preserve">, </text>
              <code xml:space="preserve">normalize-space()</code>
              <text xml:space="preserve">) to generate deterministic heading anchor IDs.</text>
            </paragraph>
          </item>
        </list>
      </document>
    </body>
  </page>
</xao-docs>
