| 1 | <?xml version="1.0" encoding="utf-8"?> | 
|---|
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | 
|---|
| 3 |                 version="1.0"> | 
|---|
| 4 |   <xsl:include href="annotation.xsl"/> | 
|---|
| 5 |   <xsl:include href="template.xsl"/> | 
|---|
| 6 |   <xsl:include href="function.xsl"/> | 
|---|
| 7 |   <xsl:include href="type.xsl"/> | 
|---|
| 8 |   <xsl:include href="source-highlight.xsl"/> | 
|---|
| 9 |   <xsl:include href="utility.xsl"/> | 
|---|
| 10 |   <xsl:include href="lookup.xsl"/> | 
|---|
| 11 |   <xsl:include href="library.xsl"/> | 
|---|
| 12 |   <xsl:include href="index.xsl"/> | 
|---|
| 13 |   <xsl:include href="error.xsl"/> | 
|---|
| 14 |   <xsl:include href="macro.xsl"/> | 
|---|
| 15 |   <xsl:include href="testing/testsuite.xsl"/> | 
|---|
| 16 |   <xsl:include href="caramel/concept2docbook.xsl"/> | 
|---|
| 17 |    | 
|---|
| 18 |   <xsl:template name="namespace-synopsis"> | 
|---|
| 19 |     <xsl:param name="indentation" select="0"/> | 
|---|
| 20 |     <!-- Open namespace--> | 
|---|
| 21 |     <xsl:call-template name="indent"> | 
|---|
| 22 |       <xsl:with-param name="indentation" select="$indentation"/> | 
|---|
| 23 |     </xsl:call-template> | 
|---|
| 24 |     <xsl:call-template name="source-highlight"> | 
|---|
| 25 |       <xsl:with-param name="text" select="concat('namespace ',@name)"/> | 
|---|
| 26 |     </xsl:call-template> | 
|---|
| 27 |     <xsl:text> {</xsl:text> | 
|---|
| 28 |      | 
|---|
| 29 |     <!-- Emit namespace types --> | 
|---|
| 30 |     <xsl:apply-templates select="class|class-specialization| | 
|---|
| 31 |                                  struct|struct-specialization| | 
|---|
| 32 |                                  union|union-specialization| | 
|---|
| 33 |                                  typedef|enum" mode="synopsis"> | 
|---|
| 34 |       <xsl:with-param name="indentation" select="$indentation + 2"/> | 
|---|
| 35 |     </xsl:apply-templates> | 
|---|
| 36 |      | 
|---|
| 37 |     <!-- Emit namespace functions --> | 
|---|
| 38 |     <xsl:apply-templates  | 
|---|
| 39 |       select="free-function-group|function|overloaded-function"  | 
|---|
| 40 |       mode="synopsis"> | 
|---|
| 41 |       <xsl:with-param name="indentation" select="$indentation + 2"/> | 
|---|
| 42 |     </xsl:apply-templates> | 
|---|
| 43 |      | 
|---|
| 44 |     <!-- Emit namespaces --> | 
|---|
| 45 |     <xsl:apply-templates select="namespace" mode="synopsis"> | 
|---|
| 46 |       <xsl:with-param name="indentation" select="$indentation + 2"/> | 
|---|
| 47 |     </xsl:apply-templates> | 
|---|
| 48 |      | 
|---|
| 49 |     <!-- Close namespace --> | 
|---|
| 50 |     <xsl:text>
</xsl:text> | 
|---|
| 51 |     <xsl:call-template name="indent"> | 
|---|
| 52 |       <xsl:with-param name="indentation" select="$indentation"/> | 
|---|
| 53 |     </xsl:call-template> | 
|---|
| 54 |     <xsl:text>}</xsl:text> | 
|---|
| 55 |   </xsl:template> | 
|---|
| 56 |  | 
|---|
| 57 |   <!-- Emit namespace synopsis --> | 
|---|
| 58 |   <xsl:template match="namespace" mode="synopsis"> | 
|---|
| 59 |     <xsl:param name="indentation" select="0"/> | 
|---|
| 60 |  | 
|---|
| 61 |     <xsl:choose> | 
|---|
| 62 |       <xsl:when test="count(ancestor::namespace)=0"> | 
|---|
| 63 |         <xsl:call-template name="namespace-synopsis"> | 
|---|
| 64 |           <xsl:with-param name="indentation" select="$indentation"/> | 
|---|
| 65 |         </xsl:call-template> | 
|---|
| 66 |       </xsl:when> | 
|---|
| 67 |       <xsl:otherwise> | 
|---|
| 68 |         <xsl:text>
</xsl:text> | 
|---|
| 69 |         <xsl:call-template name="namespace-synopsis"> | 
|---|
| 70 |           <xsl:with-param name="indentation" select="$indentation"/> | 
|---|
| 71 |         </xsl:call-template> | 
|---|
| 72 |       </xsl:otherwise> | 
|---|
| 73 |     </xsl:choose> | 
|---|
| 74 |   </xsl:template> | 
|---|
| 75 |  | 
|---|
| 76 |   <!-- Emit namespace reference --> | 
|---|
| 77 |   <xsl:template match="namespace" mode="reference"> | 
|---|
| 78 |     <xsl:apply-templates select="namespace|typedef|free-function-group" | 
|---|
| 79 |       mode="reference"> | 
|---|
| 80 |       <xsl:with-param name="indentation" select="0"/> | 
|---|
| 81 |     </xsl:apply-templates> | 
|---|
| 82 |     <xsl:apply-templates select="class|class-specialization| | 
|---|
| 83 |                                  struct|struct-specialization| | 
|---|
| 84 |                                  union|union-specialization|enum|function| | 
|---|
| 85 |                                  overloaded-function" | 
|---|
| 86 |       mode="namespace-reference"/> | 
|---|
| 87 |   </xsl:template> | 
|---|
| 88 |  | 
|---|
| 89 |   <!-- Eat extra documentation when in the synopsis or reference sections --> | 
|---|
| 90 |   <xsl:template match="para|section" mode="synopsis"/> | 
|---|
| 91 |   <xsl:template match="para|section" mode="reference"/> | 
|---|
| 92 |  | 
|---|
| 93 |   <!-- Comment mode tries to wipe out any extra spacing in the output --> | 
|---|
| 94 |   <xsl:template match="purpose" mode="comment"> | 
|---|
| 95 |     <xsl:apply-templates mode="comment"/> | 
|---|
| 96 |   </xsl:template> | 
|---|
| 97 |  | 
|---|
| 98 |   <xsl:template match="simpara|para" mode="comment"> | 
|---|
| 99 |     <xsl:apply-templates select="text()|*" mode="comment"/> | 
|---|
| 100 |   </xsl:template> | 
|---|
| 101 |  | 
|---|
| 102 |   <xsl:template match="text()" mode="comment"> | 
|---|
| 103 |     <xsl:value-of select="."/> | 
|---|
| 104 |   </xsl:template> | 
|---|
| 105 |  | 
|---|
| 106 |   <xsl:template match="*" mode="comment"> | 
|---|
| 107 |     <xsl:apply-templates select="." mode="annotation"/> | 
|---|
| 108 |   </xsl:template> | 
|---|
| 109 | </xsl:stylesheet> | 
|---|