xslt-dita-helper
Skill2 starsChanged 6 months agoMITView on GitHub
Provides XSLT and XPath assistance for DITA 1.3 transformations, including DITA-OT plugin development. Use this skill when you need XPath expressions for DITA element selection, XSLT template match patterns using DITA class attributes, transformation override guidance for DITA-OT, or help with specialization class attribute values.
In this repository18 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- context-setupSkill
- dita-best-practicesSkill
- ditaval-helperSkill
- error-handlingSkill
- generate-bookmapSkill
- generate-ditamapSkill
- generate-dita-topicSkill
- generate-keyrefsSkill
- keyspace-debugSkill
- map-resolveSkill
- pdf-to-ditaSkill
- refactor-dita-contentSkill
- review-dita-guideSkill
- validate-bookmapSkill
- validate-ditamapSkill
- validate-dita-topicSkill
- visitor-extendSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 57
Import xsl/dita2htmlImpl.xsl in your stylesheet
- Very specific: line 58
Write a higher-priority template: <xsl:template match="..." priority="10">
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Generates and validates XSLT patterns for DITA content transformation.
Key principle: always match by @class, not by element name
DITA elements carry a @class attribute encoding the specialization hierarchy. Matching by element name breaks with specializations; matching by @class is robust.
<!-- ✅ Robust — works for all specializations of task/taskbody -->
<xsl:template match="*[contains(@class, ' task/taskbody ')]">
<div class="taskbody"><xsl:apply-templates/></div>
</xsl:template>
<!-- ❌ Fragile — breaks if a specialization renames the element -->
<xsl:template match="taskbody">
<div class="taskbody"><xsl:apply-templates/></div>
</xsl:template>Class attribute reference
See references/CLASS-ATTRIBUTES.md for the full table.
Quick reference for common elements:
| Element | @class token to match |
| Any topic | topic/topic |
| concept | concept/concept |
| task | task/task |
| taskbody | task/taskbody |
| step / cmd | task/step / task/cmd |
| reference | reference/reference |
| refbody | reference/refbody |
| refsyn | reference/refsyn |
| properties table | reference/properties |
| troubleshooting | troubleshooting/troubleshooting |
| troubleSolution | troubleshooting/troubleSolution |
| map / topicref | map/map / map/topicref |
XSLT patterns reference
See assets/xslt-patterns.xsl for ready-to-use templates.
DITA-OT plugin override guidance
To override a built-in DITA-OT template in a plugin:
- Set
plugin.xmlto declare axsl/xslhtmlextension point - Import
xsl/dita2htmlImpl.xslin your stylesheet - Write a higher-priority template:
<xsl:template match="..." priority="10">
See references/DITA-OT-PLUGIN.md for full plugin scaffolding steps.
Common edge cases
contains(@class, ' task/cmd ')— note the surrounding spaces in the string literal; they are required to avoid partial matches- Processing instruction
<?dita-ot ...?>nodes: useprocessing-instruction('dita-ot')in your XPath @outputclassis the DITA hook for custom CSS classes — pass it through with<xsl:attribute name="class" select="@outputclass"/>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

