On Sat, 2003-01-18 at 15:02, Miguel de Icaza wrote:
> Hey guys,
> 
>    I posted this to the docs mailing list, but got no input so far. 
> Anyone could help us with this?
> 
> Miguel

I have to leave now but I think this should do the job? Attached is the
template and a test file that I used. Note it doesn't munge the text in
<see> correctly; there are string routines but I don't have time to look
them up.

-- 
Peter Williams     [EMAIL PROTECTED] / [EMAIL PROTECTED]

"[Ninjas] are cool; and by cool, I mean totally sweet."
                              -- REAL Ultimate Power
<super>
   <sub>
      <para>This is some stuff</para>
      <para>With <child>sub</child> elements</para>
      <para>Also, see <see cref="Foo.Bar.Bam"/> too</para>
      <para>Also, <paramref name="bob"/> is cool too.</para>
   </sub>
</super>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE xsl:stylesheet>

<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    version="1.0">

  <xsl:output method="xml"/>

  <!-- Basically, copy the entire tree, except for:
        * para -> p
        * see -> a href
        * paramref -> i -->

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="para">
    <p>
      <xsl:apply-templates select="@*|node()"/>
    </p>
  </xsl:template>

  <xsl:template match="see">
    <a href="{@cref}"><xsl:value-of select="@cref"/></a>
  </xsl:template>

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

</xsl:stylesheet>

Reply via email to