Hello!

    I am using the first attached XSLT in the Mono documentation
browser, but it is not handling a couple of entries:

    This should be rendered in <pre>:

        <example>
        </example>

    <see langword="XXXX"/>

    Should be rendered as:

        <a href="langword:XXXX">XXXX</a>

    Could someone help me?

Miguel

<?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="see">
                <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:template>
        

        
</xsl:stylesheet>

Reply via email to