A multilingual tarot card reference built with pure XML/XSLT technologies.
This project serves as a learning platform for:
- XPath — querying XML data structures
- XSLT — transforming XML into HTML
- XQuery concepts — treating XML files as a database
tarot/
├── index.xml # English entry point
├── index-uk.xml # Ukrainian entry point
├── data/ # XML Database
│ ├── structure.xml # Card hierarchy (Major/Minor Arcana)
│ ├── metadata.xml # Card metadata (numbers, symbols, suits)
│ └── locales/ # Translations
│ ├── deck.en.xml # English card translations
│ ├── deck.uk.xml # Ukrainian card translations
│ └── ui.xml # UI strings (all languages)
├── styles/
│ ├── tarot.xsl # Main XSLT stylesheet (data queries)
│ └── main.css # Nord theme styling
├── scripts/
│ └── helper.js # Minimal JS (only URL routing & UI)
└── assets/
└── img/big/ # Rider-Waite card images
The project treats XML files as database tables:
- structure.xml — Primary key table (card IDs, arcana types)
- metadata.xml — Metadata table (card numbers, Hebrew letters, astrological signs)
- deck.{lang}.xml — Localization tables (card titles & descriptions)
- ui.xml — UI strings table (interface translations)
XSLT performs JOIN operations using XPath:
<xsl:variable name="meta" select="$db_metadata/card[@id=$cid]"/>
<xsl:variable name="loc" select="$db_deck/card[@id=$cid]"/>-
Create
data/locales/deck.{lang}.xml(copy fromdeck.en.xml) -
Add UI strings to
data/locales/ui.xml:<strings lang="{lang}"> <title>...</title> <nav><major>...</major><minor>...</minor></nav> <footer>...</footer> </strings>
-
Create
index-{lang}.xmlentry point:<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="styles/tarot.xsl"?> <page lang="{lang}"> <content>...</content> </page>
-
Update language switcher buttons in
tarot.xsl
npx http-server . -p 8080Then open:
- English:
http://localhost:8080/index.xml - Ukrainian:
http://localhost:8080/index-uk.xml
- Color Palette: Nord theme
- Typography: Outfit (headings), Inter (body)
- Layout: Responsive CSS Grid
- Aesthetic: Minimalist, clean, focused on content
Modern browsers (Firefox, Chrome) block document() calls in JavaScript-initiated XSLT transformations due to CORS policy. This project uses native browser XSLT processing triggered by <?xml-stylesheet?> processing instructions, avoiding CORS issues entirely.
JavaScript is minimal and handles only:
- Language switching (URL redirection)
- Card click handlers (modal display)
- Modal window management
All data queries and transformations are performed in pure XSLT.
Educational project. Card images from the public domain Rider-Waite deck.
