Hey guys!

   I need some more help with my XSLT.   I asked Peter first this time,
as he always reply quickly, but he is busy this week ;-)   

    We need a few more tags supported, the details are here:

        www.go-mono.com/documentation.html

   The tags am looking to support are:

        <code lang="C#">.. </code>

        Those happen inside the "<example>" bits.

   <list type="bullet">  </list>

   That is basically a <ul> list in HTML

   And the table ones:

        <list type="table"> </lits>
            <listheader>
              <term>YOUR FIRST COLUMN</term>
              <description>YOUR DESCRIPTION</description>
            </listheader>

        <item>
                <term>First</term>
                <description>First descritpion</description>
        </item>
        <item>
                <term>Second</term>
                <description>Second descirption</description>
        </item>

Here is again my XSLT file
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        
        <xsl:template name="string-replace" >
          <xsl:param name="string"/>
          <xsl:param name="from"/>
          <xsl:choose>
                  <xsl:when test="contains($string,'(')">
                  <xsl:call-template name="string-replace">
                  <xsl:with-param name="string" 
select="substring-before($string,'(')"/>
                  <xsl:with-param name="from" select="$from"/>
                  </xsl:call-template>
                </xsl:when>
                <xsl:when test="contains($string,$from)">
                  <xsl:call-template name="string-replace">
                  <xsl:with-param name="string" 
select="substring-after($string,$from)"/>
                  <xsl:with-param name="from" select="$from"/>
                  </xsl:call-template>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$string"/>
                </xsl:otherwise>
          </xsl:choose>
        </xsl:template> 

        <xsl:template name="string-addsignature">
          <xsl:param name="string"/>
          <xsl:choose>
                  <xsl:when test="contains($string,'(')">
                                (<xsl:value-of select="substring-after($string,'(')"/>
                        </xsl:when>
          </xsl:choose>
        </xsl:template> 
        
        
        <xsl:template match="document">
                <html>
                        <head><title>Prueba de mono</title></head>
                <xsl:apply-templates/>
                </html>
        </xsl:template>

        <xsl:template match="para">
                <p>
                        <xsl:apply-templates/>
                </p>
        </xsl:template>

        <xsl:template match="paramref">
                <i><xsl:value-of select="@name"/>
                                <xsl:apply-templates/>
                </i>
        </xsl:template>

        <xsl:template match="example">
                <pre>
                        <xsl:apply-templates/>
                </pre>
        </xsl:template>
        
        <xsl:template match="see">
                <xsl:choose>
                <xsl:when test="string-length(@langword)=0">
                        <a href="{@cref}">
                                <xsl:call-template name="string-replace">
                                        <xsl:with-param name="string" select="@cref"/>
                                        <xsl:with-param name="from">.</xsl:with-param>
                                </xsl:call-template>
                                <xsl:call-template name="string-addsignature">
                                  <xsl:with-param name="string" select="@cref"/>
                                </xsl:call-template>
                                <xsl:apply-templates/>
                        </a>
                </xsl:when>
                <xsl:otherwise>
                        <a href="{@langword}"><xsl:value-of select="@langword"/></a>
                </xsl:otherwise>
                </xsl:choose>     
        </xsl:template>
        

        
</xsl:stylesheet>

Reply via email to