source: draft-ietf-httpbis/latest/abnf2xml2rfc.xslt @ 425

Last change on this file since 425 was 425, checked in by julian.reschke@…, 11 years ago

reference RFC5234 core rules directly, fix line end bug in appendix generation (related to #36)

File size: 1.1 KB
RevLine 
[420]1<xsl:transform
2  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3  version="2.0">
4
5<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
6 
7<xsl:param name="abnf"/> 
8 
9<xsl:template match="/">
[421]10  <xsl:variable name="collected" select="unparsed-text($abnf)"/>
[420]11
[421]12  <section title="Collected ABNF" anchor="collected.abnf"> 
[420]13<figure>
14  <artwork type="abnf" name="{$abnf}">
[425]15    <xsl:text>&#10;</xsl:text>
16    <xsl:value-of select="translate($collected,'&#13;','')"/>
[420]17  </artwork>
18</figure> 
[421]19  </section>
[420]20
[425]21  <!-- check whether it's up-to-date... -->
[421]22 
[425]23  <xsl:if test="not(//section[@anchor='collected.abnf']) or normalize-space(//section[@anchor='collected.abnf']//artwork) != normalize-space($collected)">
[421]24    <xsl:message>WARNING: appendix contained inside source document needs to be updated</xsl:message>
[425]25    <!--<xsl:message>A: <xsl:value-of select="//section[@anchor='collected.abnf']//artwork"/></xsl:message>
[421]26    <xsl:message>B: <xsl:value-of select="$collected"/></xsl:message>-->
27  </xsl:if>
[420]28</xsl:template>
29 
30 
31</xsl:transform>
Note: See TracBrowser for help on using the repository browser.