<!-- Generic tag entities -->
<!ENTITY % inlinetags "em | strong | code | a | br | directive | module |
-program | img | cite | q | dfn | var | transnote | glossary | phonetic | since">
+program | img | cite | q | dfn | var | transnote | glossary | phonetic | since | rfc">
<!ENTITY % blocktags "p | example | note | table | ul | ol | dl | pre |
highlight | blockquote">
describes a pronunciation -->
<!ELEMENT phonetic (#PCDATA)>
+<!-- The rfc element creates a link to an RFC at www.rfc-editor.org.
+ Content is the RFC number (e.g. 7230). Optional section attribute
+ adds a fragment anchor (e.g. section="14.24"). -->
+<!ELEMENT rfc (#PCDATA)>
+<!ATTLIST rfc section CDATA #IMPLIED>
+
<!-- /glossary -->
<!-- ==================================================================== -->
+<!-- link to an RFC at www.rfc-editor.org -->
+<!-- ==================================================================== -->
+<xsl:template match="rfc">
+ <xsl:variable name="rfcnum">
+ <xsl:value-of select="normalize-space(.)"/>
+ </xsl:variable>
+
+ <xsl:variable name="rfcurl">
+ <xsl:text>https://www.rfc-editor.org/rfc/rfc</xsl:text>
+ <xsl:value-of select="$rfcnum"/>
+ <xsl:if test="@section">
+ <xsl:text>#section-</xsl:text>
+ <xsl:value-of select="@section"/>
+ </xsl:if>
+ </xsl:variable>
+
+ <a href="{$rfcurl}">RFC <xsl:value-of select="$rfcnum"/></a>
+</xsl:template>
+<!-- /rfc -->
+
<!-- Filter   in text() nodes. -->
<!-- In some environments this character won't be transformed correctly, -->
<!-- so we just write it explicitly as " " into the output. -->
<!-- ==================================================================== -->
<!-- pass through content -->
<!-- ==================================================================== -->
-<xsl:template match="a|module|table|program|glossary|highlight">
+<xsl:template match="a|module|table|program|glossary|highlight|rfc">
<xsl:apply-templates />
</xsl:template>