- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 03 Feb 2010 10:27:07 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/markup/tools In directory hutz:/tmp/cvs-serv23922/tools Modified Files: generate-spec-source.xsl specgen.xsl toc.xsl Log Message: reworked annotations handling for new/obsolete/changed elements Index: generate-spec-source.xsl =================================================================== RCS file: /sources/public/html5/markup/tools/generate-spec-source.xsl,v retrieving revision 1.226 retrieving revision 1.227 diff -u -d -r1.226 -r1.227 --- generate-spec-source.xsl 2 Feb 2010 17:04:54 -0000 1.226 +++ generate-spec-source.xsl 3 Feb 2010 10:27:05 -0000 1.227 @@ -36,6 +36,28 @@ </s:rule> </xsl:for-each> </xsl:variable> + <xsl:variable name="warnings"> + <xsl:for-each + select="document('../schema/warnings.sch')//*[@context]"> + <s:rule> + <xsl:choose> + <xsl:when test="contains(@context,'|')"> + <xsl:for-each select="str:tokenize(@context,'|')"> + <xsl:call-template name="get-context"/> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="@context"> + <xsl:call-template name="get-context"/> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + <xsl:for-each select="s:report|s:assert"> + <xsl:copy-of select="."/> + </xsl:for-each> + </s:rule> + </xsl:for-each> + </xsl:variable> <xsl:template match="/"> <html xml:lang="en"> <xsl:text> </xsl:text> @@ -813,6 +835,15 @@ [not(@name='meta')] )" > + <xsl:variable name="obsoleted"> + <xsl:if test="document(concat('../elements/',$name,'.html'))//*[@class[contains(.,'obsoleted')]]"> obsoleted</xsl:if> + </xsl:variable> + <xsl:variable name="changed"> + <xsl:if test="document(concat('../elements/',$name,'.html'))//*[@class[contains(.,'changed')]]"> changed</xsl:if> + </xsl:variable> + <xsl:variable name="new"> + <xsl:if test="document(concat('../elements/',$name,'.html'))//*[@class[contains(.,'new')]]"> new</xsl:if> + </xsl:variable> <xsl:choose> <xsl:when test="$name='button.submit'"> <xsl:text> </xsl:text> @@ -922,7 +953,13 @@ <xsl:message> <xsl:value-of select="$short-name"/> </xsl:message> - <section id="{$name}" class="no-number"> + <section> + <xsl:attribute name="id"> + <xsl:value-of select="$name"/> + </xsl:attribute> + <xsl:attribute name="class"> + <xsl:value-of select="concat('no-number',$obsoleted,$changed,$new)"/> + </xsl:attribute> <xsl:text> </xsl:text> <h2 class="element-head"> <xsl:choose> @@ -1025,6 +1062,24 @@ </xsl:otherwise> </xsl:choose> </span> + <xsl:if test='not($obsoleted="")'> + <xsl:text> </xsl:text> + <span class="obsoleted-element" + title="This markup feature has been obsoleted in HTML5." + >OBSOLETE</span> + </xsl:if> + <xsl:if test='not($changed="")'> + <xsl:text> </xsl:text> + <span class="changed-element" + title="The meaning of this markup feature has changed in HTML5." + >CHANGED</span> + </xsl:if> + <xsl:if test='not($new="")'> + <xsl:text> </xsl:text> + <span class="new-element" + title="This markup feature is newly added in HTML5." + >NEW</span> + </xsl:if> </h2> <xsl:text> </xsl:text> <xsl:variable name="space-name"> @@ -2063,6 +2118,7 @@ <!-- * ***************************************************************** --> <xsl:template name="make.attribute.definition"> <xsl:param name="name"/> + <xsl:param name="attribute-name" select="."/> <xsl:param name="href" select="@href"/> <xsl:param name="wrapper">dt</xsl:param> <xsl:choose> @@ -2255,6 +2311,18 @@ </xsl:otherwise> </xsl:choose> <xsl:text> </xsl:text> + <xsl:if + test="exsl:node-set($warnings)/s:rule[child::s:context = $name] + [child::s:report[@test[contains(.,concat('@',$attribute-name))]]] + "> + <dd class="warning"> + <span class="admonition-marker">Warning: </span> + <xsl:value-of + select="exsl:node-set($warnings)/s:rule[child::s:context = $name] + /s:report[@test[contains(.,concat('@',$attribute-name))]] + "/> + </dd> + </xsl:if> </xsl:if> </xsl:when> <xsl:otherwise> Index: specgen.xsl =================================================================== RCS file: /sources/public/html5/markup/tools/specgen.xsl,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- specgen.xsl 2 Feb 2010 17:04:54 -0000 1.46 +++ specgen.xsl 3 Feb 2010 10:27:05 -0000 1.47 @@ -607,7 +607,25 @@ <xsl:call-template name="write.chunk"> <xsl:with-param name="quiet" select="$quiet"/> <xsl:with-param name="content" select="$content"/> - <xsl:with-param name="title" select="concat('HTML5: ',normalize-space(h:h2))"/> + <xsl:with-param name="title"> + <xsl:text>HTML5: </xsl:text> + <xsl:for-each select='h:h2/node() + [not(contains(@class,"obsoleted-element"))] + [not(contains(@class,"changed-element"))] + [not(contains(@class,"new-element"))] + '> + <xsl:copy-of select='.'/> + </xsl:for-each> + <xsl:if test='h:h2/node()[contains(@class,"obsoleted-element")]'> + <xsl:text>(OBSOLETE)</xsl:text> + </xsl:if> + <xsl:if test='h:h2/node()[contains(@class,"changed-element")]'> + <xsl:text>(CHANGED)</xsl:text> + </xsl:if> + <xsl:if test='h:h2/node()[contains(@class,"new-element")]'> + <xsl:text>(NEW)</xsl:text> + </xsl:if> + </xsl:with-param> <xsl:with-param name="filename"> <xsl:if test="not($aria=0)"> <xsl:text>aria/</xsl:text> Index: toc.xsl =================================================================== RCS file: /sources/public/html5/markup/tools/toc.xsl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- toc.xsl 2 Feb 2010 17:04:54 -0000 1.9 +++ toc.xsl 3 Feb 2010 10:27:05 -0000 1.10 @@ -84,75 +84,33 @@ <xsl:text>.</xsl:text> </xsl:if> </span> - <xsl:text> </xsl:text> - <xsl:copy-of select='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()'/> - </a> - <xsl:if test='@id="aside" - or @id="audio" - or @id="canvas" - or @id="command" - or @id="command.command" - or @id="command.radio" - or @id="command.checkbox" - or @id="command.checkbox" - or @id="datalist" - or @id="details" - or @id="dialog" - or @id="figure" - or @id="figcaption" - or @id="header" - or @id="hgroup" - or @id="input.datetime" - or @id="input.datetime-local" - or @id="input.date" - or @id="input.month" - or @id="input.time" - or @id="input.week" - or @id="input.number" - or @id="input.range" - or @id="input.email" - or @id="input.url" - or @id="input.search" - or @id="input.tel" - or @id="input.color" - or @id="keygen" - or @id="mark" - or @id="meta.charset" - or @id="meter" - or @id="nav" - or @id="output" - or @id="output" - or @id="progress" - or @id="rp" - or @id="rt" - or @id="ruby" - or @id="section" - or @id="source" - or @id="summary" - or @id="time" - or @id="video" + <xsl:for-each select='(h:h2|h:h3|h:h4|h:h5|h:h6)/node() + [not(normalize-space(.)="")] + [not(contains(@class,"obsoleted-element"))] + [not(contains(@class,"changed-element"))] + [not(contains(@class,"new-element"))] '> + <xsl:text> </xsl:text> + <xsl:copy-of select='.'/> + </xsl:for-each> + </a> + <xsl:if test='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()[contains(@class,"obsoleted-element")]'> <xsl:text> </xsl:text> - <span class="new-element" - title="This element is newly added in HTML5." - >NEW</span> + <span class="obsoleted-element" + title="This markup feature has been obsoleted in HTML5." + >OBSOLETE</span> </xsl:if> - <xsl:if test='@id="b" - or @id="hr" - or @id="i" - or @id="menu" - or @id="small" - or @id="strong" - '> + <xsl:if test='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()[contains(@class,"changed-element")]'> <xsl:text> </xsl:text> <span class="changed-element" - title="The meaning of this element has changed in HTML5." + title="The meaning of this markup feature has changed in HTML5." >CHANGED</span> </xsl:if> - <xsl:if test='h:h2[@class = "element-head"] - and .//*[@class = "obsolete"]'> + <xsl:if test='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()[contains(@class,"new-element")]'> <xsl:text> </xsl:text> - <span class="obsolete">(obsolete)</span> + <span class="new-element" + title="This markup feature is newly added in HTML5." + >NEW</span> </xsl:if> <xsl:text> </xsl:text> <xsl:if test="$unexpanded=0">
Received on Wednesday, 3 February 2010 10:27:09 UTC