Changeset 1303 for rfc2629xslt/rfc2629toXHTML.xslt
- Timestamp:
- 01/06/11 09:03:44 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rfc2629xslt/rfc2629toXHTML.xslt
r1276 r1303 184 184 <xsl:with-param name="attr" select="'trace-parse-xml'"/> 185 185 <xsl:with-param name="default" select="'no'"/> 186 </xsl:call-template> 187 </xsl:param> 188 189 <!-- extension for excluding the index --> 190 191 <xsl:param name="xml2rfc-ext-include-index"> 192 <xsl:call-template name="parse-pis"> 193 <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/> 194 <xsl:with-param name="attr" select="'include-index'"/> 195 <xsl:with-param name="default" select="'yes'"/> 186 196 </xsl:call-template> 187 197 </xsl:param> … … 356 366 <xsl:call-template name="warning"> 357 367 <xsl:with-param name="msg" select="concat('/rfc/@consensus meaningless with a /rfc/@submissionType value of ', /rfc/@submissionType)"/> 358 <xsl:with-param name="inline" select="'no'"/>359 368 </xsl:call-template> 360 369 </xsl:if> … … 429 438 430 439 <!-- will document have an index --> 431 <xsl:variable name="has-index" select=" //iref or (//xref and $xml2rfc-ext-include-references-in-index='yes')"/>440 <xsl:variable name="has-index" select="(//iref or (//xref and $xml2rfc-ext-include-references-in-index='yes')) and $xml2rfc-ext-include-index!='no'"/> 432 441 433 442 <!-- does the document contain edits? --> … … 605 614 <xsl:if test="string-length($content) > 69 + $indent"> 606 615 <xsl:call-template name="warning"> 607 <xsl:with-param name="inline" select="'no'"/>608 616 <xsl:with-param name="msg">artwork line too long: '<xsl:value-of select="$content"/>' (<xsl:value-of select="string-length($content)"/> characters)</xsl:with-param> 609 617 </xsl:call-template> … … 621 629 <xsl:if test="string-length($start) > $max"> 622 630 <xsl:call-template name="warning"> 623 <xsl:with-param name="inline" select="'no'"/>624 631 <xsl:with-param name="msg">artwork line too long: '<xsl:value-of select="$start"/>' (<xsl:value-of select="string-length($start)"/> characters)</xsl:with-param> 625 632 </xsl:call-template> … … 931 938 <xsl:call-template name="warning"> 932 939 <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should contain the base name, not the filename (thus no file extension).</xsl:with-param> 933 <xsl:with-param name="inline" select="'no'"/>934 940 </xsl:call-template> 935 941 <xsl:value-of select="substring-before($docname,'.')"/> … … 946 952 <xsl:call-template name="warning"> 947 953 <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should not contain the character '<xsl:value-of select="substring($offending,1,1)"/>'.</xsl:with-param> 948 <xsl:with-param name="inline" select="'no'"/>949 954 </xsl:call-template> 950 955 </xsl:if> … … 954 959 <xsl:call-template name="warning"> 955 960 <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should not contain the character sequence '--'.</xsl:with-param> 956 <xsl:with-param name="inline" select="'no'"/>957 961 </xsl:call-template> 958 962 </xsl:if> … … 961 965 <xsl:call-template name="warning"> 962 966 <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should start with 'draft-'.</xsl:with-param> 963 <xsl:with-param name="inline" select="'no'"/>964 967 </xsl:call-template> 965 968 </xsl:if> … … 977 980 <xsl:call-template name="warning"> 978 981 <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should end with a two-digit sequence number or 'latest'.</xsl:with-param> 979 <xsl:with-param name="inline" select="'no'"/>980 982 </xsl:call-template> 981 983 </xsl:if> … … 984 986 <xsl:call-template name="warning"> 985 987 <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>', excluding sequence number, should have less than 50 characters.</xsl:with-param> 986 <xsl:with-param name="inline" select="'no'"/>987 988 </xsl:call-template> 988 989 </xsl:if> … … 1398 1399 <xsl:if test="not(ancestor::ed:del) and not(key('xref-item',$anchor))"> 1399 1400 <xsl:call-template name="warning"> 1400 <xsl:with-param name="inline" select="'no'"/>1401 1401 <xsl:with-param name="msg">unused reference '<xsl:value-of select="@anchor"/>'</xsl:with-param> 1402 1402 </xsl:call-template> … … 1416 1416 <xsl:if test="$tst=''"> 1417 1417 <xsl:call-template name="warning"> 1418 <xsl:with-param name="inline" select="'no'"/>1419 1418 <xsl:with-param name="msg">all references to the normative reference '<xsl:value-of select="@anchor"/>' appear to be informative</xsl:with-param> 1420 1419 </xsl:call-template> … … 1553 1552 <xsl:if test="(@name='BCP' or @name='FYI' or @name='STD') and preceding-sibling::seriesInfo[@name='RFC']"> 1554 1553 <xsl:call-template name="warning"> 1555 <xsl:with-param name="inline" select="'no'"/>1556 1554 <xsl:with-param name="msg">RFC number preceding <xsl:value-of select="@name"/> number in reference '<xsl:value-of select="../@anchor"/>'</xsl:with-param> 1557 1555 </xsl:call-template> … … 1569 1567 <xsl:if test="string(number(front/date/@year)) = 'NaN'"> 1570 1568 <xsl:call-template name="warning"> 1571 <xsl:with-param name="inline" select="'no'"/>1572 1569 <xsl:with-param name="msg">date/@year should be a number: '<xsl:value-of select="front/date/@year"/>' in reference '<xsl:value-of select="@anchor"/>'</xsl:with-param> 1573 1570 </xsl:call-template> … … 1821 1818 <xsl:template match="t"> 1822 1819 <xsl:if test="preceding-sibling::section or preceding-sibling::appendix"> 1823 <xsl:call-template name=" warning">1820 <xsl:call-template name="inline-warning"> 1824 1821 <xsl:with-param name="msg">The paragraph below is misplaced; maybe a section is closed in the wrong place: </xsl:with-param> 1825 1822 <xsl:with-param name="msg2"><xsl:value-of select="."/></xsl:with-param> … … 1887 1884 <xsl:if test="@abbrev and string-length(@abbrev) > 40"> 1888 1885 <xsl:call-template name="warning"> 1889 <xsl:with-param name="inline" select="'no'"/>1890 1886 <xsl:with-param name="msg">title/@abbrev too long (max 40 characters)</xsl:with-param> 1891 1887 </xsl:call-template> … … 1894 1890 <xsl:if test="string-length(.) > 40 and (not(@abbrev) or @abbrev='')"> 1895 1891 <xsl:call-template name="warning"> 1896 <xsl:with-param name="inline" select="'no'"/>1897 1892 <xsl:with-param name="msg">title too long, should supply title/@abbrev attribute with less than 40 characters</xsl:with-param> 1898 1893 </xsl:call-template> … … 1928 1923 <xsl:if test="self::appendix"> 1929 1924 <xsl:call-template name="warning"> 1930 <xsl:with-param name="inline" select="'no'"/>1931 1925 <xsl:with-param name="msg">The "appendix" element is deprecated, use "section" inside "back" instead.</xsl:with-param> 1932 1926 </xsl:call-template> … … 2162 2156 <xsl:if test="not($r-is-normative)"> 2163 2157 <xsl:call-template name="warning"> 2164 <xsl:with-param name="inline" select="'no'"/>2165 2158 <xsl:with-param name="msg" select="concat('Potentially normative reference to ',@target,' not referenced normatively')"/> 2166 2159 </xsl:call-template> … … 2329 2322 <xsl:for-each select="$xref"> 2330 2323 <xsl:call-template name="warning"> 2331 <xsl:with-param name="inline" select="'no'"/>2332 2324 <xsl:with-param name="msg" select="concat('Potentially normative reference to ',$xref/@target,' not referenced normatively')"/> 2333 2325 </xsl:call-template> … … 2537 2529 2538 2530 <xsl:template match="/"> 2531 <xsl:apply-templates select="*" mode="validate"/> 2539 2532 <xsl:apply-templates select="*"/> 2540 2533 </xsl:template> … … 2682 2675 <xsl:call-template name="warning"> 2683 2676 <xsl:with-param name="msg" select="concat('/rfc/front/date/@day appears to be missing for a historic draft dated ', $pub-yearmonth)"/> 2684 <xsl:with-param name="inline" select="'no'"/>2685 2677 </xsl:call-template> 2686 2678 </xsl:if> … … 4848 4840 <xsl:value-of select="$name"/> 4849 4841 <xsl:call-template name="warning"> 4850 <xsl:with-param name="inline" select="'no'"/>4851 4842 <xsl:with-param name="msg" select="concat('In metadata obsoletes/updates, RFC number of draft name is expected - found: ',$name)"/> 4852 4843 </xsl:call-template> … … 4883 4874 <xsl:if test="not(//references//reference/seriesInfo[@name='Internet-Draft' and @value=$name])"> 4884 4875 <xsl:call-template name="warning"> 4885 <xsl:with-param name="inline" select="'no'"/>4886 4876 <xsl:with-param name="msg" select="concat('front matter mentions I-D ',$name,' for which there is no reference element')"/> 4887 4877 </xsl:call-template> … … 4891 4881 <xsl:if test="not(//references//reference/seriesInfo[@name='RFC' and @value=$name])"> 4892 4882 <xsl:call-template name="warning"> 4893 <xsl:with-param name="inline" select="'no'"/>4894 4883 <xsl:with-param name="msg" select="concat('front matter mentions RFC ',$name,' for which there is no reference element')"/> 4895 4884 </xsl:call-template> … … 4971 4960 <xsl:otherwise> 4972 4961 <xsl:call-template name="warning"> 4973 <xsl:with-param name="inline" select="'no'"/>4974 4962 <xsl:with-param name="msg">internal link target for '<xsl:value-of select="."/>' does not exist.</xsl:with-param> 4975 4963 </xsl:call-template> … … 5556 5544 <xsl:if test="not(//reference/seriesInfo[@name='RFC' and (@value='2068' or @value='2616')])"> 5557 5545 <xsl:call-template name="warning"> 5558 <xsl:with-param name="inline">no</xsl:with-param>5559 5546 <xsl:with-param name="msg">document uses HTTP-style ABNF syntax, but doesn't reference RFC 2068 or 2616.</xsl:with-param> 5560 5547 </xsl:call-template> … … 5564 5551 <xsl:if test="not(//reference/seriesInfo[@name='RFC' and (@value='2234' or @value='4234' or @value='5234')])"> 5565 5552 <xsl:call-template name="warning"> 5566 <xsl:with-param name="inline">no</xsl:with-param>5567 5553 <xsl:with-param name="msg">document uses ABNF syntax, but doesn't reference RFC 2234, 4234 or 5234.</xsl:with-param> 5568 5554 </xsl:call-template> … … 5808 5794 </xsl:template> 5809 5795 5796 <xsl:template name="inline-warning"> 5797 <xsl:param name="msg"/> 5798 <xsl:param name="msg2"/> 5799 <xsl:call-template name="emit-message"> 5800 <xsl:with-param name="level">WARNING</xsl:with-param> 5801 <xsl:with-param name="msg" select="$msg"/> 5802 <xsl:with-param name="msg2" select="$msg2"/> 5803 <xsl:with-param name="inline" select="'yes'"/> 5804 </xsl:call-template> 5805 </xsl:template> 5806 5810 5807 <xsl:template name="warning"> 5811 5808 <xsl:param name="msg"/> … … 5816 5813 <xsl:with-param name="msg" select="$msg"/> 5817 5814 <xsl:with-param name="msg2" select="$msg2"/> 5818 <xsl:with-param name="inline" select=" $inline"/>5815 <xsl:with-param name="inline" select="'no'"/> 5819 5816 </xsl:call-template> 5820 5817 </xsl:template> … … 5926 5923 <xsl:otherwise> 5927 5924 <xsl:call-template name="warning"> 5928 <xsl:with-param name="inline" select="'no'"/>5929 5925 <xsl:with-param name="msg">Unknown align attribute on ttcol: <xsl:value-of select="$col/@align"/></xsl:with-param> 5930 5926 </xsl:call-template> … … 6174 6170 <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text> 6175 6171 <!-- when RCS keyword substitution in place, add version info --> 6176 <xsl:if test="contains('$Revision: 1.5 47$',':')">6177 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.5 47$', 'Revision: '),'$','')),', ')"/>6172 <xsl:if test="contains('$Revision: 1.550 $',':')"> 6173 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.550 $', 'Revision: '),'$','')),', ')"/> 6178 6174 </xsl:if> 6179 <xsl:if test="contains('$Date: 2011-0 4-17 09:42:41$',':')">6180 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2011-0 4-17 09:42:41$', 'Date: '),'$','')),', ')"/>6175 <xsl:if test="contains('$Date: 2011-05-30 14:02:12 $',':')"> 6176 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2011-05-30 14:02:12 $', 'Date: '),'$','')),', ')"/> 6181 6177 </xsl:if> 6182 6178 <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))"/> … … 6193 6189 <xsl:if test="contains(.,',')"> 6194 6190 <xsl:call-template name="warning"> 6195 <xsl:with-param name="inline" select="'no'"/>6196 6191 <xsl:with-param name="msg">keyword element appears to contain a comma-separated list, split into multiple elements instead.</xsl:with-param> 6197 6192 </xsl:call-template> … … 6316 6311 <xsl:if test="$r!=@initials"> 6317 6312 <xsl:call-template name="warning"> 6318 <xsl:with-param name="inline" select="'no'"/>6319 6313 <xsl:with-param name="msg">@initials '<xsl:value-of select="@initials"/>': did you mean '<xsl:value-of select="$r"/>'?</xsl:with-param> 6320 6314 </xsl:call-template> … … 6382 6376 <xsl:if test="string-length($node) != string-length($text)"> 6383 6377 <xsl:call-template name="warning"> 6384 <xsl:with-param name="inline" select="'no'"/>6385 6378 <xsl:with-param name="msg">excessive whitespace in <xsl:value-of select="$name"/>: '<xsl:value-of select="$node"/>'</xsl:with-param> 6386 6379 </xsl:call-template> … … 6394 6387 <xsl:if test="string-length(.) != string-length($email) or contains($email,' ')"> 6395 6388 <xsl:call-template name="warning"> 6396 <xsl:with-param name="inline" select="'no'"/>6397 6389 <xsl:with-param name="msg">excessive whitespace in email address: '<xsl:value-of select="."/>'</xsl:with-param> 6398 6390 </xsl:call-template> … … 6403 6395 <xsl:when test="starts-with($email,'mailto:')"> 6404 6396 <xsl:call-template name="warning"> 6405 <xsl:with-param name="inline" select="'no'"/>6406 6397 <xsl:with-param name="msg">email should not include URI scheme: '<xsl:value-of select="."/>'</xsl:with-param> 6407 6398 </xsl:call-template> … … 6422 6413 <xsl:if test="string-length(.) != string-length($uri) or contains($uri,' ')"> 6423 6414 <xsl:call-template name="warning"> 6424 <xsl:with-param name="inline" select="'no'"/>6425 6415 <xsl:with-param name="msg">excessive whitespace in URI: '<xsl:value-of select="."/>'</xsl:with-param> 6426 6416 </xsl:call-template> … … 6523 6513 <xsl:call-template name="warning"> 6524 6514 <xsl:with-param name="msg">bad PI syntax: <xsl:value-of select="$str2"/></xsl:with-param> 6525 <xsl:with-param name="inline" select="'no'"/>6526 6515 </xsl:call-template> 6527 6516 <xsl:value-of select="$ret"/> … … 6533 6522 <xsl:call-template name="warning"> 6534 6523 <xsl:with-param name="msg">bad PI value syntax: <xsl:value-of select="$remainder"/></xsl:with-param> 6535 <xsl:with-param name="inline" select="'no'"/>6536 6524 </xsl:call-template> 6537 6525 <xsl:value-of select="$ret"/> … … 6550 6538 <xsl:call-template name="warning"> 6551 6539 <xsl:with-param name="msg">pseudo-attribute value needs to be quoted: <xsl:value-of select="$rem"/></xsl:with-param> 6552 <xsl:with-param name="inline" select="'no'"/>6553 6540 </xsl:call-template> 6554 6541 <xsl:value-of select="$ret"/> … … 6557 6544 <xsl:call-template name="warning"> 6558 6545 <xsl:with-param name="msg">unmatched quote in: <xsl:value-of select="$rem2"/></xsl:with-param> 6559 <xsl:with-param name="inline" select="'no'"/>6560 6546 </xsl:call-template> 6561 6547 <xsl:value-of select="$ret"/> … … 6570 6556 <xsl:when test="$attrname='authors-section'"/> 6571 6557 <xsl:when test="$attrname='duplex'"/> 6558 <xsl:when test="$attrname='include-index'"/> 6572 6559 <xsl:when test="$attrname='include-references-in-index'"/> 6573 6560 <xsl:when test="$attrname='justification'"/> … … 6579 6566 <xsl:call-template name="warning"> 6580 6567 <xsl:with-param name="msg">unsupported rfc-ext pseudo-attribute '<xsl:value-of select="$attrname"/>'</xsl:with-param> 6581 <xsl:with-param name="inline" select="'no'"/>6582 6568 </xsl:call-template> 6583 6569 </xsl:otherwise> … … 6590 6576 <xsl:call-template name="warning"> 6591 6577 <xsl:with-param name="msg">the rfc include pseudo-attribute is not supported by this processor, see http://greenbytes.de/tech/webdav/rfc2629xslt/rfc2629xslt.html#examples.internalsubset for help.</xsl:with-param> 6592 <xsl:with-param name="inline" select="'no'"/>6593 6578 </xsl:call-template> 6594 6579 </xsl:when> … … 6612 6597 <xsl:call-template name="warning"> 6613 6598 <xsl:with-param name="msg">duplicate pseudo-attribute <xsl:value-of select="$attr"/>, overwriting value <xsl:value-of select="$ret"/></xsl:with-param> 6614 <xsl:with-param name="inline" select="'no'"/>6615 6599 </xsl:call-template> 6616 6600 </xsl:if> … … 6803 6787 <xsl:when test="$current-year!='' and $may-default-dates!='yes'"> 6804 6788 <xsl:call-template name="warning"> 6805 <xsl:with-param name="inline" select="'no'"/>6806 6789 <xsl:with-param name="msg" select="$may-default-dates"/> 6807 6790 </xsl:call-template> … … 6827 6810 <xsl:when test="$current-month!='' and $may-default-dates!='yes'"> 6828 6811 <xsl:call-template name="warning"> 6829 <xsl:with-param name="inline" select="'no'"/>6830 6812 <xsl:with-param name="msg" select="$may-default-dates"/> 6831 6813 </xsl:call-template> … … 6872 6854 <xsl:otherwise>00</xsl:otherwise> 6873 6855 </xsl:choose> 6874 6875 6856 </xsl:param> 6876 6857 6858 <!-- simple validation support --> 6859 6860 <xsl:template match="*" mode="validate"> 6861 <xsl:apply-templates select="@*|*" mode="validate"/> 6862 </xsl:template> 6863 <xsl:template match="@*" mode="validate"/> 6864 6865 <xsl:template name="warninvalid"> 6866 <xsl:variable name="pname"> 6867 <xsl:if test="namespace-uri(..)!=''"> 6868 <xsl:value-of select="concat('{',namespace-uri(..),'}')"/> 6869 </xsl:if> 6870 <xsl:value-of select="local-name(..)"/> 6871 </xsl:variable> 6872 <xsl:variable name="cname"> 6873 <xsl:if test="namespace-uri(.)!=''"> 6874 <xsl:value-of select="concat('{',namespace-uri(.),'}')"/> 6875 </xsl:if> 6876 <xsl:value-of select="local-name(.)"/> 6877 </xsl:variable> 6878 <xsl:call-template name="warning"> 6879 <xsl:with-param name="msg" select="concat($cname,' not allowed inside ',$pname)"/> 6880 </xsl:call-template> 6881 </xsl:template> 6882 6883 <!-- figure element --> 6884 <xsl:template match="figure/artwork | figure/ed:replace/ed:*/artwork" mode="validate" priority="9"> 6885 <xsl:apply-templates select="@*|*" mode="validate"/> 6886 </xsl:template> 6887 <xsl:template match="artwork" mode="validate"> 6888 <xsl:call-template name="warninvalid"/> 6889 <xsl:apply-templates select="@*|*" mode="validate"/> 6890 </xsl:template> 6891 6892 <!-- list element --> 6893 <xsl:template match="t/list | t/ed:replace/ed:*/list" mode="validate" priority="9"> 6894 <xsl:apply-templates select="@*|*" mode="validate"/> 6895 </xsl:template> 6896 <xsl:template match="list" mode="validate"> 6897 <xsl:call-template name="warninvalid"/> 6898 <xsl:apply-templates select="@*|*" mode="validate"/> 6899 </xsl:template> 6900 6901 <!-- t element --> 6902 <xsl:template match="abstract/t | abstract/ed:replace/ed:*/t | list/t | list/ed:replace/ed:*/t | note/t | note/ed:replace/ed:*/t | section/t | section/ed:replace/ed:*/t | x:blockquote/t | x:blockquote/ed:replace/ed:*/t | x:note/t | x:note/ed:replace/ed:*/t | x:lt/t | x:lt/ed:replace/ed:*/t" mode="validate" priority="9"> 6903 <xsl:apply-templates select="@*|*" mode="validate"/> 6904 </xsl:template> 6905 <xsl:template match="t" mode="validate"> 6906 <xsl:call-template name="warninvalid"/> 6907 <xsl:apply-templates select="@*|*" mode="validate"/> 6908 </xsl:template> 6909 6877 6910 </xsl:transform>
Note: See TracChangeset
for help on using the changeset viewer.