nib rearranging
[TestXSLT.git] / Distribution / readme2rtf.xsl
1 <?xml version="1.0" encoding="ISO-8859-1"?>\r\r<xsl:stylesheet    version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\r\r<!-- Need to instruct the XSLT processor to use text output rules for RTF.\r     See http://www.w3.org/TR/xslt#output for more details\r-->\r<xsl:output method="text"/>\r\r\r\r\r<!-- This first template matches our root element in the input file.\r     This will trigger the generation of some RTF code at the very beginning\r     of the output document and of a closing } brace at the very end.\r     In between we let the processor recursively process any contained\r     elements, which is what the apply-templates instruction does.\r-->     \r<xsl:template match='readme'>\r<xsl:text>{\rtf1\mac\ansicpg10000\cocoartf100\r{\fonttbl\f0\fnil\fcharset77 LucidaGrande-Bold;\f1\fnil\fcharset77 LucidaGrande;}\r{\colortbl;\red255\green255\blue255;\red8\green61\blue161;}\r\margl1440\margr1440\vieww13260\viewh10420\viewkind0\r\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\r\r</xsl:text>\r<xsl:apply-templates/>\r<xsl:text>}</xsl:text>\r</xsl:template>\r\r\r\r<!-- Match the readme title. Output some RTF code to make it bold -->\r<xsl:template match="title">\r\f0\b\fs28 \cf0 <xsl:apply-templates/>\\r</xsl:template>\r\r\r\r<!-- Match the author title. Output some RTF code to make it bold.\r     The author element might contain other markup, like the email address.\r     Again, this will be resolved recursively using apply-templates.\r-->\r<xsl:template match="author">\r\f1\b0\fs24 \\r\\r\f0\b <xsl:apply-templates/>\\r</xsl:template>\r\r\r\r<!-- Match description. Contains nested para elements -->\r<xsl:template match="description">\r\\r\f0\b \ Description\\r\f1\b0 \r<xsl:apply-templates/>\r</xsl:template>\r\r\r\r<!-- paragraphs inside descriptions -->\r<xsl:template match="para">\r<xsl:apply-templates/>\\r\\r</xsl:template>\r\r\r\r<!-- Make URLs blue. Can't do anything better in RTF -->\r<xsl:template match="url">\r\cf2 <xsl:apply-templates/>\cf0 \r</xsl:template>\r\r\r\r<!-- Make email blue and add angle brackets (lt and gt) -->\r<xsl:template match="email">\r\cf2 &lt;<xsl:apply-templates/>&gt;\cf0 \r</xsl:template>\r\r\r\r<!-- Output Requirements title -->\r<xsl:template match="requirements">\r\f0\b \ Requirements\\r\f1\b0 <xsl:apply-templates/>\\r\\r</xsl:template>\r\r\r\r<!-- Output version history. First output the bold title -->\r<xsl:template match="history">\r\f0\b History\r\f1\b0 \\r<xsl:apply-templates/>\r</xsl:template>\r\r\r\r<!-- Inside history, we will find entry elements.\r     For these, we will put the date and version on one line\r     in this template using value-of instructions. Then we'll\r     recursively let it process all item elements\r-->\r<xsl:template match="entry">\r<xsl:value-of select="date"/> Version <xsl:value-of select="version"/>\\r<xsl:apply-templates select="item"/>\r\\r</xsl:template>\r\r\r\r<!-- One item element, multiple are possible in an entry.\r     Output a dash and space, then the item text\r-->\r<xsl:template match="item">\r- <xsl:apply-templates/>\\r</xsl:template>\r\r</xsl:stylesheet>\r