gwt.team.scottb | ab0aa68 | 2006-12-06 23:14:19 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <!-- Transforms booklet expositive documentation into Topics --> |
| 3 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 4 | <xsl:output method="xml"/> |
| 5 | |
| 6 | <xsl:template match="/"> |
| 7 | <topics> |
| 8 | <xsl:apply-templates select="booklet"/> |
| 9 | </topics> |
| 10 | </xsl:template> |
| 11 | |
| 12 | <xsl:template match="booklet"> |
| 13 | <xsl:apply-templates select="package/*"/> |
| 14 | </xsl:template> |
| 15 | |
| 16 | <xsl:template match="class | interface"> |
| 17 | <topic> |
| 18 | <id><xsl:value-of select="id"/></id> |
| 19 | |
| 20 | <xsl:if test="tags/order"> |
| 21 | <order><xsl:value-of select="tags/order"/></order> |
| 22 | </xsl:if> |
| 23 | |
| 24 | <xsl:variable name="title"> |
| 25 | <xsl:value-of select="tags/title"/> |
| 26 | <xsl:if test="not(tags/title)"> |
| 27 | <xsl:comment>[Missing title]</xsl:comment> |
| 28 | </xsl:if> |
| 29 | </xsl:variable> |
| 30 | |
| 31 | <title> |
| 32 | <xsl:value-of select="$title"/> |
| 33 | </title> |
| 34 | |
| 35 | <xsl:if test="location/link"> |
| 36 | <location> |
| 37 | <xsl:for-each select="location/link"> |
| 38 | <xsl:if test="position() > 2"> |
| 39 | <span class="item"><xsl:copy-of select="."/></span> > |
| 40 | </xsl:if> |
| 41 | </xsl:for-each> |
| 42 | <span class="selected item"> |
| 43 | <xsl:value-of select="$title"/> |
| 44 | </span> |
| 45 | </location> |
| 46 | </xsl:if> |
| 47 | |
| 48 | <xsl:for-each select="tags/index"> |
| 49 | <index><xsl:value-of select="."/></index> |
| 50 | </xsl:for-each> |
| 51 | |
| 52 | <xsl:for-each select="tags/tip"> |
| 53 | <xsl:copy-of select="."/> |
| 54 | </xsl:for-each> |
| 55 | |
| 56 | <xsl:if test="tags/synopsis"> |
| 57 | <synopsis><xsl:copy-of select="tags/synopsis/node()"/></synopsis> |
| 58 | </xsl:if> |
| 59 | |
| 60 | <body><xsl:copy-of select="description/node()"/></body> |
| 61 | |
| 62 | <!-- See also --> |
| 63 | <xsl:if test="tags/link"> |
| 64 | <seeAlso> |
| 65 | <xsl:for-each select="tags/link"> |
| 66 | <xsl:copy-of select="."/> |
| 67 | </xsl:for-each> |
| 68 | </seeAlso> |
| 69 | </xsl:if> |
| 70 | |
| 71 | <xsl:if test="tags/childIntro"> |
| 72 | <childIntro><xsl:copy-of select="tags/childIntro/node()"/></childIntro> |
| 73 | </xsl:if> |
| 74 | |
| 75 | <xsl:apply-templates select="class | interface"/> |
| 76 | </topic> |
| 77 | </xsl:template> |
| 78 | |
| 79 | <xsl:template match="*|node()"> |
| 80 | <!-- quiet --> |
| 81 | </xsl:template> |
| 82 | </xsl:stylesheet> |