GIMME AN X
GIMME AN L
GIMME AN S
GIMME A T
X S L T !
Intro to XSLT
How is XSLT different from other programming languages? XSLT can mediate between different documents.
I use command line validators but Oxygen is great for thorough debugging, so we will use Oxygen. Download here if you don't already have it, register for a free 30-day trial, and confirm code.
- Setting it up
- How to use it
- Valid or not?
Elements, attributes, siblings, ancestors, children, descendents?
/Element @attribute parent/.. ../child(ren)
Notes on nodes
.. -- gets you up to the parent element
/.. -- gets you to the child element
ancestor::___ -- gets you up as high as it needs to go // -- finds everything underneath, like text//p finds all p under text, no matter how far down it is. All descendants.
select="following-sibling::_" -- all nodes after that node gt for greater than and lt for lesser than when testing logic statements. Can't use < or > because that is used in the XML structure.
Three conditional statements: if, choose, for each.
- Example: Roles
- Example 2: PBCore to DublinCore
- Example 3: MediaConch output to HTML, to TXT, to XML
- Example 4: MARC to MODS in NYPL Metadata Management System
- Example 5: MODS to NYPL Digital Collections
- Example 6: LoC MARC to MODS XSL
- scripts/mediainfo xml xsl
- scripts/roles xml xsl
- scripts/movies xml xsl | answers
- scripts/movies (html) xsl | answers
Command line tools