- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Sun, 01 Aug 2010 06:36:55 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/markup/tools In directory hutz:/tmp/cvs-serv5640/tools Modified Files: generate-spec-source.xsl Log Message: include selected datatype/microsyntax descriptions at point of use, along with attribute descriptions, and reworked some individual datatype descriptions Index: generate-spec-source.xsl =================================================================== RCS file: /sources/public/html5/markup/tools/generate-spec-source.xsl,v retrieving revision 1.285 retrieving revision 1.286 diff -u -d -r1.285 -r1.286 --- generate-spec-source.xsl 31 Jul 2010 20:31:25 -0000 1.285 +++ generate-spec-source.xsl 1 Aug 2010 06:36:53 -0000 1.286 @@ -15,6 +15,7 @@ <xsl:param name="head" select="document('../src/head.html')"/> <xsl:param name="header" select="document('../src/header.src.html')"/> <xsl:key name="elements" match="*" use="@id"/> + <xsl:key name="datatypes" match="h:dt" use="."/> <xsl:key name="filename-map" match="ul" use="li"/> <xsl:key name="interface-name" match="pre[@class='idl']" use="dfn/@id"/> <xsl:variable name="htmlelement-filename"> @@ -113,7 +114,7 @@ <p>This section describes content models that are referenced by a number of different element descriptions in the - <i>Content model</i> + <i class="subsection-citation">Content model</i> subsections of the per-element documentation in the <a href="#elements">HTML elements</a> section.</p> @@ -436,10 +437,10 @@ <h2 class="common-subhead"><dfn id="{@id}">Language tag</dfn></h2> </xsl:when> <xsl:when test="$pattern='datetime'"> - <h2 class="common-subhead"><dfn id="{@id}">Date-time</dfn></h2> + <h2 class="common-subhead"><dfn id="{@id}">Date and time</dfn></h2> </xsl:when> <xsl:when test="$pattern='datetime-local'"> - <h2 class="common-subhead"><dfn id="{@id}">Local date-time</dfn></h2> + <h2 class="common-subhead"><dfn id="{@id}">Local date and time</dfn></h2> </xsl:when> <xsl:when test="$pattern='date-or-time'"> <h2 class="common-subhead"><dfn id="{@id}">Date or time</dfn></h2> @@ -469,7 +470,7 @@ <h2 class="common-subhead"><dfn id="{@id}">MIME type</dfn></h2> </xsl:when> <xsl:when test="$pattern='mimetypelist'"> - <h2 class="common-subhead"><dfn id="{@id}">list of MIME types</dfn></h2> + <h2 class="common-subhead"><dfn id="{@id}">List of MIME types</dfn></h2> </xsl:when> <xsl:when test="$pattern='emailaddresslist'"> <h2 class="common-subhead"><dfn id="{@id}">List of e-mail addresses</dfn></h2> @@ -477,8 +478,11 @@ <xsl:when test="$pattern='emailaddress'"> <h2 class="common-subhead"><dfn id="{@id}">E-mail address</dfn></h2> </xsl:when> + <xsl:when test="$pattern='float'"> + <h2 class="common-subhead"><dfn id="{@id}">Floating-point number</dfn></h2> + </xsl:when> <xsl:when test="$pattern='float.non-negative'"> - <h2 class="common-subhead"><dfn id="{@id}">Non-negative float</dfn></h2> + <h2 class="common-subhead"><dfn id="{@id}">Non-negative floating-point number</dfn></h2> </xsl:when> <xsl:when test="$pattern='integer.non-negative'"> <h2 class="common-subhead"><dfn id="{@id}">Non-negative integer</dfn></h2> @@ -487,7 +491,7 @@ <h2 class="common-subhead"><dfn id="{@id}">Positive integer</dfn></h2> </xsl:when> <xsl:when test="$pattern='float.positive'"> - <h2 class="common-subhead"><dfn id="{@id}">Positive float</dfn></h2> + <h2 class="common-subhead"><dfn id="{@id}">Positive floating-point number</dfn></h2> </xsl:when> <xsl:when test="$pattern='uri.absolute'"> <h2 class="common-subhead"><dfn id="{@id}">Absolute URL</dfn></h2> @@ -1464,9 +1468,9 @@ <xsl:for-each select="node()"> <xsl:choose> <xsl:when test="self::i[class='vendor-value']"> - <i class="vendor-value"> + <var class="vendor-value"> <xsl:copy-of select="node()"/> - </i> + </var> </xsl:when> <xsl:when test="self::span[@class='predicate']"> <span class="predicate"> @@ -1500,9 +1504,9 @@ <xsl:for-each select="name/node()"> <xsl:choose> <xsl:when test="local-name() = 'i'"> - <i class="vendor-value"> + <var class="vendor-value"> <xsl:copy-of select="node()"/> - </i> + </var> </xsl:when> <xsl:otherwise> <xsl:copy-of select="."/> @@ -1515,9 +1519,9 @@ <xsl:for-each select="value/node()"> <xsl:choose> <xsl:when test="local-name() = 'i'"> - <i class="vendor-value"> + <var class="vendor-value"> <xsl:copy-of select="node()"/> - </i> + </var> </xsl:when> <xsl:otherwise> <xsl:copy-of select="."/> @@ -2383,6 +2387,7 @@ <xsl:value-of select="substring-after($href,'#')"/> </xsl:variable> <xsl:text> </xsl:text> + <xsl:variable name="definition"> <dt> <xsl:variable name="spec-target"> <xsl:choose> @@ -2617,6 +2622,8 @@ </xsl:otherwise> </xsl:choose> </dt> + </xsl:variable> + <xsl:copy-of select="$definition"/> <xsl:text> </xsl:text> <xsl:choose> <xsl:when test="$ref = 'common.attrs' or $ref = 'global-attributes'"> @@ -2654,6 +2661,57 @@ "/> </dd> </xsl:if> + <xsl:for-each select="exsl:node-set($definition)/*/*[@class='attr-values']/h:a"> + <xsl:if test=" + starts-with(@href,'#common.data.') + or starts-with(@href,'#form.data.') + "> + <xsl:variable name="datatype"> + <xsl:choose> + <xsl:when test="starts-with(@href,'#common.data.')"> + <xsl:value-of select="substring-after(@href,'#common.data.')"/> + </xsl:when> + <xsl:when test="starts-with(@href,'#form.data.')"> + <xsl:value-of select="substring-after(@href,'#form.data.')"/> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="document('../src/datatypes.html')"> + <xsl:if test="not( + $datatype = 'tokens' + or $datatype = 'idref' + or $datatype = 'default-style' + or $datatype = 'sandbox-allow-list' + or starts-with($datatype,'uri') + or starts-with($datatype,'integer') + or starts-with($datatype,'float') + )"> + <xsl:text> </xsl:text> + <xsl:for-each select="key('datatypes',$datatype)/following-sibling::h:dd[not(position() = 1)]"> + <dd> + <xsl:for-each select="*"> + <xsl:element name="{local-name()}"> + <xsl:copy-of select="@*"/> + <xsl:for-each select="node()"> + <xsl:choose> + <xsl:when test="@id"> + <var class="defined-elsewhere"> + <xsl:copy-of select="node()"/> + </var> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:element> + </xsl:for-each> + </dd> + </xsl:for-each> + </xsl:if> + </xsl:for-each> + </xsl:if> + </xsl:for-each> </xsl:when> <xsl:otherwise> <!-- * do nothing --> @@ -2665,12 +2723,7 @@ <xsl:variable name="shape" select="substring-after($ref,'area.attrs.shape.')"/> <xsl:variable name="coords.pattern" select="concat('area.attrs.coords.',$shape)"/> <xsl:for-each select="$rnc-html"> - <a class="attribute-name" - id="{$ref}" - title="{$ref}" - href="#{$ref}"> - <xsl:text>shape</xsl:text> - </a> + <span class="attribute-name">shape</span> <xsl:text> = </xsl:text> <span class="attr-values"> <xsl:variable name="model"> @@ -2685,13 +2738,7 @@ <xsl:if test="not($ref='area.attrs.shape.default')"> <span class="punc postfix &">&</span> <xsl:text> </xsl:text> - <a class="attribute-name" - id="{$coords.pattern}" - title="{$coords.pattern}" - href="#{$coords.pattern}" - > - <xsl:text>coords</xsl:text> - </a> + <span class="attribute-name">coords</span> <xsl:text> = </xsl:text> <span class="attr-values"> <xsl:for-each select="key('elements',$coords.pattern)//*[@class='model']//h:a"> @@ -2702,6 +2749,24 @@ </xsl:for-each> </span> </xsl:if> + <xsl:text> </xsl:text> + <a class="hash" + id="{$ref}" + title="{$ref}" + href="#{$ref}"> + <xsl:text>#</xsl:text> + </a> + <xsl:text> </xsl:text> + <xsl:if test="not($ref='area.attrs.shape.default')"> + <a class="hash" + id="{$coords.pattern}" + title="{$coords.pattern}" + href="#{$coords.pattern}" + > + <xsl:text>#</xsl:text> + </a> + <xsl:text> </xsl:text> + </xsl:if> </xsl:for-each> </xsl:template> @@ -3170,10 +3235,10 @@ <a href="{@href}">language tag</a> </xsl:when> <xsl:when test=".='datetime'"> - <a href="{@href}">date-time</a> + <a href="{@href}">date and time</a> </xsl:when> <xsl:when test=".='datetime-local'"> - <a href="{@href}">local date-time</a> + <a href="{@href}">local date and time</a> </xsl:when> <xsl:when test=".='date-or-time'"> <a href="{@href}">date or time</a> @@ -3211,8 +3276,11 @@ <xsl:when test=".='emailaddress'"> <a href="{@href}">e-mail address</a> </xsl:when> + <xsl:when test=".='float'"> + <a href="{@href}">floating-point number</a> + </xsl:when> <xsl:when test=".='float.non-negative'"> - <a href="{@href}">non-negative float</a> + <a href="{@href}">non-negative floating-point number</a> </xsl:when> <xsl:when test=".='integer.non-negative'"> <a href="{@href}">non-negative integer</a> @@ -3221,7 +3289,7 @@ <a href="{@href}">positive integer</a> </xsl:when> <xsl:when test=".='float.positive'"> - <a href="{@href}">positive float</a> + <a href="{@href}">positive floating-point number</a> </xsl:when> <xsl:when test=".='uri.absolute'"> <a href="{@href}">absolute URL</a>
Received on Sunday, 1 August 2010 06:36:58 UTC