[Mono-list] More help needed with XSLT.

Miguel de Icaza miguel@ximian.com
17 Feb 2003 20:29:57 -0500


--=-DdR1WT/c2tNRwk/tS0zz
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

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


--=-DdR1WT/c2tNRwk/tS0zz
Content-Disposition: attachment; filename=mono-ecma.xsl
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=mono-ecma.xsl; charset=ISO-8859-1

<?xml version=3D"1.0"?>
<xsl:stylesheet version=3D"1.0" xmlns:xsl=3D"http://www.w3.org/1999/XSL/Tra=
nsform">
=09
	<xsl:template name=3D"string-replace" >
	  <xsl:param name=3D"string"/>
	  <xsl:param name=3D"from"/>
	  <xsl:choose>
		  <xsl:when test=3D"contains($string,'(')">
		  <xsl:call-template name=3D"string-replace">
		  <xsl:with-param name=3D"string" select=3D"substring-before($string,'(')=
"/>
		  <xsl:with-param name=3D"from" select=3D"$from"/>
		  </xsl:call-template>
		</xsl:when>
		<xsl:when test=3D"contains($string,$from)">
		  <xsl:call-template name=3D"string-replace">
		  <xsl:with-param name=3D"string" select=3D"substring-after($string,$from=
)"/>
		  <xsl:with-param name=3D"from" select=3D"$from"/>
		  </xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
		  <xsl:value-of select=3D"$string"/>
		</xsl:otherwise>
	  </xsl:choose>
	</xsl:template>=09

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

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

	<xsl:template match=3D"paramref">
		<i><xsl:value-of select=3D"@name"/>
				<xsl:apply-templates/>
		</i>
	</xsl:template>
=09
	<xsl:template match=3D"see">
		<a href=3D"{@cref}">

			<xsl:call-template name=3D"string-replace">
			  <xsl:with-param name=3D"string" select=3D"@cref"/>
			  <xsl:with-param name=3D"from">.</xsl:with-param>
		  </xsl:call-template>
		 =20
		  <xsl:call-template name=3D"string-addsignature">
			  <xsl:with-param name=3D"string" select=3D"@cref"/>
		  </xsl:call-template>
		 =20

				<xsl:apply-templates/>
		</a>
	</xsl:template>
=09

=09
</xsl:stylesheet>
--=-DdR1WT/c2tNRwk/tS0zz--