Einführung in XSL

1. Was ist XSL?

XSL = eXtensible Stylesheet Language

Das was CSS (Cascading Style Sheets) bereits unter HTML ist, soll XSL unter XML werden. Eine Sprache die für die optische Gestaltung eines Dokumentes zuständig ist. Unter XML werden strukturelle oder semantische Auszeichnungen mit Hilfe von XSL in eine optische ansprechende und leicht änderbare Form gebracht. Stärker als unter HTML ist bei XML-Dokumenten eine Trennung von Semantik und Darstellung erforderlich.

2. Unterschiede zu CSS

  1. Mit XSL können XML-Dokumente nach HTML konvertiert werden
  2. XSL besitzt mehr Funktionen als CSS
  3. Bei XSL kann man auch eigene Funktionen definieren
  4. HTML-Elemente müssen unter XSL für jedes Dokument neu spezifiziert werden

3. Elemente von XSL

Eine XSL-Formatvorlage beginnt mit <XSL> und endet mit </XSL>

Alle Attribute innerhalb von XSL 1.0

AttributEigenschaftVoreinstellungvererbtProzentangabe
absolute-positionauto | absolute | fixed | inheritautonoN/A
active-statelink | visited | active | hover | focusno, a value is requirednoN/A
alignment-adjustauto | <percentage> | <length> | inheritautonosee prose
auto-restoreyes | nonoyesN/A
azimuth<angle> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | inheritcenteryesN/A
background[<background-color> || <background-image> || <background-repeat> || <background-attachment> || <background-position> | ]]inheritnot defined for shorthand propertiesnoallowed on 'background-position'
background-attachmentscroll | fixed | inheritscrollnoN/A
background-color<color> | transparent | inherittransparentnoN/A
background-image<uri> | none | inheritnonenoN/A
background-position[ [<percentage> | <length> ]{1,2} | [ [top | center | bottom] || [left | center | right] ] ] | inherit0% 0%norefer to the size of the box itself
background-position-horizontal<percentage> | <length> | left | center | right | inherit0%norefer to the size of the padding-rectangle
background-position-vertical<percentage> | <length> | top | center | bottom | inherit0%norefer to the size of the padding-rectangle
background-repeatrepeat | repeat-x | repeat-y | no-repeat | inheritrepeatnoN/A
baseline-identifierbaseline | before-edge | text-before-edge | middle | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | inheritsee prosenoN/A
baseline-shiftbaseline | sub | super | <percentage> | <length> | inheritbaselinenorefers to the "line-height" of the parent area
blank-or-not-blankblank | not-blank | any | inheritanynoN/A
block-progression-dimensionauto | <length> | <percentage> | <length-range> | inheritautonosee prose
border[ <border-width> || <border-style> || <color> ] | inheritsee individual propertiesnoN/A
border-after-color<color> | inheritthe value of the 'color' propertynoN/A
border-after-style<border-style> | inheritnonenoN/A
border-after-width<border-width> | <length-conditional> | inheritmediumnoN/A
border-before-color<color> | inheritthe value of the 'color' propertynoN/A
border-before-style<border-style> | inheritnonenoN/A
border-before-width<border-width> | <length-conditional> | inheritmediumnoN/A
border-bottom[ <border-top-width> || <border-style> || <color> ] | inheritsee individual propertiesnoN/A
border-bottom-color<color> | inheritthe value of the 'color' propertynoN/A
border-bottom-style<border-style> | inheritnonenoN/A
border-bottom-width<border-width> | inheritmediumnoN/A
border-collapsecollapse | separate | inheritcollapseyesN/A
border-color<color>{1,4} | transparent | inheritsee individual propertiesnoN/A
border-end-color<color> | inheritthe value of the 'color' propertynoN/A
border-end-style<border-style> | inheritnonenoN/A
border-end-width<border-width> | inheritmediumnoN/A
border-left[ <border-top-width> || <border-style> || <color> ] | inheritsee individual propertiesnoN/A
border-left-color<color> | inheritthe value of the 'color' propertynoN/A
border-left-style<border-style> | inheritnonenoN/A
border-left-width<border-width> | inheritmediumnoN/A
border-right[ <border-top-width> || <border-style> || <color> ] | inheritsee individual propertiesnoN/A
border-right-color<color> | inheritthe value of the 'color' propertynoN/A
border-right-style<border-style> | inheritnonenoN/A
border-right-width<border-width> | inheritmediumnoN/A
border-separation<length-bp-ip-direction> | inherit.block-progression-direction="0pt" .inline-progression-direction="0pt"yesN/A
border-spacing<length> <length>? | inherit0ptyesN/A
border-start-color<color> | inheritthe value of the 'color' propertynoN/A
border-start-style<border-style> | inheritnonenoN/A
border-start-width<border-width> | inheritmediumnoN/A
border-style<border-style>{1,4} | inheritsee individual propertiesnoN/A
border-top[ <border-top-width> || <border-style> || <color> ] | inheritsee individual propertiesnoN/A
border-top-color<color> | inheritthe value of the 'color' propertynoN/A
border-top-style<border-style> | inheritnonenoN/A
border-top-width<border-width> | inheritmediumnoN/A
border-width<border-width>{1,4} | inheritsee individual propertiesnoN/A
bottom<length> | <percentage> | auto | inheritautonorefer to height of containing block
break-afterauto | column | page | even-page | odd-page | inheritautonoN/A
break-beforeauto | column | page | even-page | odd-page | inheritautonoN/A
caption-sidebefore | after | start | end | top | bottom | left | right | inheritbeforeyesN/A
case-name<name>none, a value is requiredno, a value is requiredN/A
case-title<string>none, a value is requiredno, a value is requiredN/A
character<character>N/A, value is requiredno, a value is requiredN/A
clearstart | end | left | right | both | none | inheritnonenoN/A
clip<shape> | auto | inheritautonoN/A
color<color> | inheritdepends on user agentyesN/A
color-profile-name<name> | inheritnoN/A
column-count<number> | inherit1noN/A
column-gap<length> | <percentage> | inherit12.0ptnorefer to width of the region being divided into columns.
column-number<number>see prosenoN/A
column-width<length>see prosenoN/A
content-heightauto | <length> | <percentage> | inheritautonointrinsic height
content-type<string> | autoautonoN/A
content-widthauto | <length> | <percentage> | inheritautonointrinsic height
countrynone | <country> | inheritnoneyesN/A
cue<cue-before> || <cue-after> | inheritnot defined for shorthand propertiesnoN/A
cue-after<uri> | none | inherit nonenoN/A
cue-before<uri> | none | inherit nonenoN/A
destination-placement-offset<length>0ptnoN/A
directionltr | rtl | inheritltryesN/A
display-alignauto | before | center | after | inheritautoyesN/A
dominant-baselineauto | autosense-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | inheritautonoN/A
elevation<angle> | below | level | above | higher | lower | inheritlevelyesN/A
empty-cellsshow | hide | inheritshowyesN/A
end-indent<length> | inherit0ptyesrefer to width of containing reference-area
ends-rowyes | nononoN/A
extent<length> | <percentage> | inherit0.0ptnorefer to the corresponding height or width of the region reference-area.
external-destination<uri-reference>null stringnoN/A
floatbefore | start | end | left | right | none | inheritnonenoN/A
flow-name<name>an empty nameno, a value is requiredN/A
font[ [ <font-style> || <font-variant> || <font-weight> ]? <font-size> [ / <line-height>]? <font-family> ] | caption | icon | menu | message-box | small-caption | status-bar | inheritsee individual propertiesyesN/A
font-family[[ <family-name> | <generic-family> ],]* [<family-name> | <generic-family>] | inheritdepends on user agentyesN/A
font-height-override-afteruse-font-metrics | <length> | inherituse-font-metricsnorefer to font's em-height
font-height-override-beforeuse-font-metrics | <length> | inherituse-font-metricsnorefer to font's em-height
font-size<absolute-size> | <relative-size> | <length> | <percentage> | inheritmediumyes, the computed value is inheritedrefer to parent element's font size
font-size-adjust<number> | none | inheritnoneyesN/A
font-stretchnormal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded |inheritnormalyesN/A
font-stylenormal | italic | oblique | backslant | inheritnormalyesN/A
font-variantnormal | small-caps | inheritnormalyesN/A
font-weightnormal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inheritnormalyesN/A
force-page-countauto | even | odd | end-on-even | end-on-odd | no-force | inheritautonoN/A
format<string>1.noN/A
glyph-orientation-horizontal<angle> | inherit0yesN/A
glyph-orientation-verticalauto | <angle> | inheritautoyesN/A
grouping-separator<character>no separatornoN/A
grouping-size<number>no groupingnoN/A
height<length> | <percentage> | auto | inheritautonosee prose
hyphenatefalse | true | inheritfalseyesN/A
hyphenation-character<character> | inheritThe unicode hyphen character u+2010yesN/A
hyphenation-keepauto | column | page | inheritnoneyesN/A
hyphenation-ladder-countno-limit | <number> | inheritno-limityesN/A
hyphenation-push-character-count<number> | inherit2yesN/A
hyphenation-remain-character-count<number> | inherit2yesN/A
id <id>see proseno, see proseN/A
indicate-destinationyes | nononoN/A
initial-page-numberauto | auto-odd | auto-even | <number> | inheritautonoN/A
inline-progression-dimensionauto | <length> | <percentage> | <length-range> | inheritautonosee prose
internal-destinationnull string | <idref>null stringnoN/A
keep-together<keep> | inherit.within-line=auto, .within-column=auto, .within-page=autoyesN/A
keep-with-next<keep> | inherit.within-line=auto, .within-column=auto, .within-page=autonoN/A
keep-with-previous<keep> | inherit.within-line=auto, .within-column=auto, .within-page=autonoN/A
languagenone | <language> | inheritnoneyesN/A
last-line-end-indent<length> | <percentage> | inherit0ptyeswidth of containing block
leader-alignmentnone | reference-area | page | inheritnoneyesN/A
leader-length<length-range> | inheritleader-length.minimum=0pt, .optimum=12.0pt, .maximum=100% yesrefer to width of content-rectangle of parent area
leader-patternspace | rule | dots | use-content | inheritspaceyesN/A
leader-pattern-widthuse-font-metrics | <length> | inherituse-font-metrics yesRefer to width of containing box
left<length> | <percentage> | auto | inheritautonorefer to height of containing block
letter-spacingnormal | <length> | <space> | inheritnormalyesN/A
letter-valueauto | alphabetic | traditionalautonoN/A
linefeed-treatmentignore | preserve | treat-as-space | inherittreat-as-spaceyesN/A
line-heightnormal | <length> | <number> | <percentage> | <space> | inheritnormalyesrefer to the font size of the element itself
line-height-shift-adjustmentconsider-shifts | disregard-shifts | inheritconsider-shiftsyesN/A
line-stacking-strategyline-height | font-height | max-height | inheritline-heightyesN/A
margin<margin-width>{1,4} | inherit not defined for shorthand properties norefer to width of containing block
margin-bottom<margin-width> | inherit0norefer to width of containing block
margin-left<margin-width> | inherit0ptnorefer to width of containing block
margin-right<margin-width> | inherit0ptnorefer to width of containing block
margin-top<margin-width> | inherit0norefer to width of containing block
marker-class-name<name>an empty nameno, a value is requiredN/A
master-name<name>an empty nameno, a value is requiredN/A
max-height<length> | <percentage> | none | inherit 0ptnorefer to height of containing block
maximum-repeats<number> | no-limit | inheritno-limitnoN/A
max-width<length> | <percentage> | none | inheritnonenorefer to width of containing block
min-height<length> | <percentage> | inherit 0ptnorefer to height of containing block
min-width<length> | <percentage> | inheritdepends on UAnorefer to width of containing block
number-columns-repeated<number>1noN/A
number-columns-spanned<number>1noN/A
number-rows-spanned<number>1noN/A
odd-or-evenodd | even | any | inheritanynoN/A
orphans<integer> | inherit2yesN/A
overflowvisible | hidden | scroll | auto | inheritautonoN/A
padding<padding-width>{1,4} | inheritnot defined for shorthand propertiesnorefer to width of containing block
padding-after<padding-width> | <length-conditional> | inherit0ptnorefer to width of containing block
padding-before<padding-width> | <length-conditional> | inherit0ptnorefer to width of containing block
padding-bottom<padding-width> | inherit0ptnorefer to width of containing block
padding-end<padding-width> | inherit0ptnorefer to width of containing block
padding-left<padding-width> | inherit0ptnorefer to width of containing block
padding-right<padding-width> | inherit0ptnorefer to width of containing block
padding-start<padding-width> | inherit0ptnorefer to width of containing block
padding-top<padding-width> | inherit0ptnorefer to width of containing block
page-break-afterauto | always | avoid | left | right | inheritautonoN/A
page-break-beforeauto | always | avoid | left | right | inheritautonoN/A
page-break-insideavoid | auto | inheritautoyesN/A
page-heightauto | indefinite | <length> | inheritautonoN/A
page-positionfirst | last | rest | any | inheritanynoN/A
page-widthauto | indefinite | <length> | inheritautonoN/A
pause[<time> | <percentage>]{1,2} | inheritdepends on user agentnosee descriptions of 'pause-before' and 'pause-after'
pause-after<time> | <percentage> | inheritdepends on user agentnosee prose
pause-before<time> | <percentage> | inheritdepends on user agentnosee prose
pitch<frequency> | x-low | low | medium | high | x-high | inheritmediumyesN/A
pitch-range<number> | inherit50yesN/A
play-during<uri> mix? repeat? | auto | none | inherit autonoN/A
positionstatic | relative | absolute | fixed | inheritstaticnoN/A
precedencetrue | false | inheritfalsenoN/A
provisional-distance-between-starts<length> | inherit24.0ptyesrefer to width of the containing box
provisional-label-separation<length> | inherit6.0ptyesrefer to width of the containing box
reference-orientation 0 | 90 | 180 | 270 | -90 | -180 | -270 | inherit0yes (see prose)N/A
ref-id<idref> | inheritnone, value requirednoN/A
region-namexsl-region-body | xsl-region-start | xsl-region-end | xsl-region-before | xsl-region-after | xsl-before-float-separator | xsl-footnote-separator | <name>see proseno, a value is requiredN/A
relative-alignbefore | baseline | inheritbeforeyesN/A
relative-positionauto | static | relative | inheritstaticnoN/A
rendering-intentauto | perceptual | relative-colorimetric | saturation | absolute-colorimetric | inheritautonoN/A
retrieve-boundarypage | page-sequence | documentpage-sequencenoN/A
retrieve-class-name<name>an empty nameno, a value is requiredN/A
retrieve-positionfirst-starting-within-page | first-including-carryover | last-starting-within-page | last-ending-within-pagefirst-starting-within-pagenoN/A
richness<number> | inherit50yesN/A
right<length> | <percentage> | auto | inheritautonorefer to height of containing block
role<string> | none | inheritnonenoN/A
rule-stylenone | dotted | dashed | solid | double | groove | ridge | inheritsolidyesN/A
rule-thickness<length>1.0ptyesN/A
scalinguniform | non-uniform | inherituniformnoN/A
scaling-methodauto | integer-pixels | resample-any-method | inheritautonoN/A
score-spacestrue | false | inherittrueyessee prose
scriptnone | auto | <script> | inheritautoyesN/A
show-destinationreplace | newreplacenoN/A
size<length>{1,2} | auto | landscape | portrait | inheritautoN/A [XSL:no, is optional]N/A
source-document<uri>+ | none | inheritnonenoN/A
space-after<space> | inheritspace.minimum=0pt, .optimum=0pt, .maximum=0pt, .conditionality=discard, .precedence=0noN/A (Differs from margin-bottom in CSS)
space-before<space> | inheritspace.minimum=0pt, .optimum=0pt, .maximum=0pt, .conditionality=discard, .precedence=0noN/A (Differs from margin-top in CSS)
space-end<space> | inheritspace.minimum=0pt, .optimum=0pt, .maximum=0pt, .conditionality=discard, .precedence=0norefer to the width of the containing area
space-start<space> | inheritspace.minimum=0pt, .optimum=0pt, .maximum=0pt, .conditionality=discard, .precedence=0norefer to the width of the containing area
space-treatmentignore | preserve | inheritpreserveyesN/A
spannone | all | inheritnonenoN/A
speaknormal | none | spell-out | inheritnormalyesN/A
speak-headeronce | always | inheritonceyesN/A
speak-numeraldigits | continuous | inheritcontinuousyesN/A
speak-punctuationcode | none | inheritnoneyesN/A
speech-rate<number> | x-slow | slow | medium | fast | x-fast | faster | slower | inheritmediumyesN/A
src <uri> | inheritnone, value requirednoN/A
start-indent<length> | inherit0ptyesrefer to width of containing reference-area
starting-stateshow | hideshownoN/A
starts-rowyes | nononoN/A
stress<number> | inherit50yesN/A
suppress-at-line-breakauto | suppress | retain | inheritautonoN/A
switch-toxsl-preceding | xsl-following | xsl-any | <name>[ <name>]*xsl-anynoN/A
table-layoutauto | fixed | inheritautonoN/A
table-omit-footer-at-breakyes | nononoN/A
table-omit-header-at-breakyes | nononoN/A
text-alignstart | center | end | justify | inside | outside | left | right | <string> | inheritstartyesN/A
text-align-lastrelative | start | center | end | justify | inside | outside | left | right | <string> | inheritrelativeyesN/A
text-decorationnone | [ [ underline | no-underline] || [ overline | no-overline ] || [ line-through | no-line-through ] || [ blink | no-blink ] ] | inheritnoneno, but see proseN/A
text-indent<length> | <percentage> | inherit0ptyesrefer to width of containing block
text-shadownone | [<color> || <length> <length> <length>? ,]* [<color> || <length> <length> <length>?] | inheritnoneno, see proseN/A
text-transformcapitalize | uppercase | lowercase | none | noneyesN/A
top<length> | <percentage> | auto | inheritautonorefer to height of containing block
treat-as-word-spaceauto | yes | no | inheritautonoN/A
unicode-bidinormal | embed | bidi-override | inheritnormalnoN/A
vertical-alignbaseline | middle | sub | super | text-top | text-bottom | <percentage> | <length> | top | bottom | inheritbaselinenorefer to the 'line-height' of the element itself
visibilityvisible | hidden | collapse | inheritvisiblenoN/A
voice-family[[<specific-voice> | <generic-voice> ],]* [<specific-voice> | <generic-voice> ] | inheritdepends on user agentyesN/A
volume<number> | <percentage> | silent | x-soft | soft | medium | loud | x-loud | inheritmediumyesrefer to inherited value
white-spacenormal | pre | nowrap | inheritnormalyesN/A
white-space-collapsefalse | true | inherittrueyesN/A
widows<integer> | inherit2yesN/A
width<length> | <percentage> | auto | inheritautonorefer to width of containing block
word-spacingnormal | <length> | <space> | inheritnormalyesN/A
wrap-optionno-wrap | wrap | inheritwrapyesN/A
writing-modelr-tb | rl-tb | tb-rl | lr | rl | tb | inheritlr-tbyes (see prose)N/A
xml:lang<country-language> | inheritnot defined for shorthand propertiesyesN/A
z-indexauto | <integer> | inheritautonoN/A

4. Einsatzmöglichkeiten von XSL

Mit Hilfe von XSL können XML-Dokumente in andere Dokumentformulare konvertiert werden.

5. Weiterführende Quellen

Extensible Stylesheet Language (XSL) Version 1.0 von W3.org

Internationale Mailingliste XSL

Deutschsprachige XSL-Seite vom bekannten Buchautor

XSL-Spezifikation (deutschsprachig)
Verfahren

Weblehre 1. April 2000  

http://www.weblehre.de/verfahren/xsl.htm