Reference

The rules

Ten content rules over DOCX and PPTX parts, each mapped to the WCAG criterion it supports, plus an OOXML-000 fallback for a package that cannot be opened.

How the audit reads OOXML parts

officelens opens the package, indexes its parts and relationship graphs, then follows the relationships to the main document part or the presentation part. It parses the XML directly and never renders the file.

<wp:docPr id="1" name="Picture 1" descr="Quarterly revenue bar chart"/>

A DOCX drawing or a PPTX shape carries its alternative text in descr. The rules read that attribute straight from the part, so a missing one is reported before the file ever reaches a renderer.

word/document.xml
The main DOCX part: body text, drawings, tables, and hyperlinks.
Headers, footers, notes, comments
DOCX rules also run over header, footer, footnote, endnote, and comment parts resolved from relationships.
ppt/slides/slideN.xml
The PPTX slides: shapes, text runs, and tables.

The ten rules

Six DOCX rules and four PPTX rules cover images, headings, tables, language, and link text.

Six DOCX rules across images, structure, language, tables, and links.
Code Severity WCAG Check
DOCX-ALT-001error1.1.1Drawing (wp:docPr) or VML image (v:shape) without descr, alt, or title; drawings with their own text body are skipped
DOCX-HEAD-002warning1.3.1Body text but no headings at all
DOCX-HEAD-003warning1.3.1Heading levels skip (for example H1 → H3)
DOCX-LANG-004warning3.1.1No default language (w:lang in docDefaults or a default style, dc:language, or w:themeFontLang)
DOCX-TBL-005error1.3.1Table whose first row is not a header (w:tblHeader)
DOCX-LINK-006warning2.4.4Hyperlink whose visible text contains a raw URL or a mailto:/tel: address
Four PPTX rules across images, titles, tables, and language.
Code Severity WCAG Check
PPTX-ALT-001error1.1.1Picture or shape (a:cNvPr) without descr; placeholders are skipped
PPTX-TITLE-002warning1.3.1Slide without a title placeholder, after checking the slide layout
PPTX-TBL-003warning1.3.1Table not marked with firstRow="1"
PPTX-LANG-004warning3.1.1Slide text with no run language (a:rPr@lang, a:endParaRPr, or inherited p:txStyles)

DOCX rules also run over header, footer, footnote, endnote, and comment parts resolved from relationships.

How a file is checked

The pipeline is static and has no rendering step.

  1. Open the package

    Unzip the OOXML container with fflate and index its parts and relationship graphs.

  2. Resolve the entry point

    Follow the relationships to the main document part or the presentation part.

  3. Parse the XML

    fast-xml-parser reads it with attributes enabled, so the rules see structure and content, never a render.

  4. Run the rules and report

    Deterministic rule functions emit issues, then text, JSON, or SARIF 2.1.0 is written and the exit code is set for CI.

OOXML-000

If a file cannot be opened as an OOXML package, or has no DOCX or PPTX main part, officelens reports one OOXML-000 (error) issue instead of an empty pass, and the CLI exits 2.