|
Revision 1:a05c6f3cbc3e, 1.2 KB
(checked in by František Kučera <franta-hg@…>, 15 years ago)
|
|
základ, první verze
|
| Line | |
|---|
| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <xsl:stylesheet version="2.0" |
|---|
| 3 | xmlns="http://www.w3.org/1999/xhtml" |
|---|
| 4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 5 | <xsl:output method="xml" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> |
|---|
| 6 | |
|---|
| 7 | <xsl:template match="/"> |
|---|
| 8 | <html> |
|---|
| 9 | <head> |
|---|
| 10 | <title><xsl:value-of select="stránka/@titulek"/></title> |
|---|
| 11 | </head> |
|---|
| 12 | <body> |
|---|
| 13 | <xsl:choose> |
|---|
| 14 | <xsl:when test="stránka/nadpis"> |
|---|
| 15 | <!-- |
|---|
| 16 | Element nadpis je nepovinný, můžeme ho použít, pokud zde chceme formátovaný text |
|---|
| 17 | nebo prostě jiný text než v titulku stránky. |
|---|
| 18 | --> |
|---|
| 19 | <h1><xsl:value-of select="stránka/nadpis"/></h1> |
|---|
| 20 | </xsl:when> |
|---|
| 21 | <xsl:otherwise> |
|---|
| 22 | <h1><xsl:value-of select="stránka/@titulek"/></h1> |
|---|
| 23 | </xsl:otherwise> |
|---|
| 24 | </xsl:choose> |
|---|
| 25 | |
|---|
| 26 | <!-- |
|---|
| 27 | Vložíme obsah stránky: |
|---|
| 28 | --> |
|---|
| 29 | <xsl:apply-templates select="stránka/node()"/> |
|---|
| 30 | </body> |
|---|
| 31 | </html> |
|---|
| 32 | </xsl:template> |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | <xsl:template match="node()|@*"> |
|---|
| 36 | <xsl:copy> |
|---|
| 37 | <xsl:apply-templates select="node()|@*"/> |
|---|
| 38 | </xsl:copy> |
|---|
| 39 | </xsl:template> |
|---|
| 40 | |
|---|
| 41 | </xsl:stylesheet> |
|---|