- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 01 May 2009 07:01:24 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/markup-spec/tools
In directory hutz:/tmp/cvs-serv27465/tools
Modified Files:
generate-spec-source.xsl specgen.xsl
Log Message:
checkpointing initial build of chunked output; not working yet completely - links on TOC not correct yet, no navigation on individual pages yet
Index: generate-spec-source.xsl
===================================================================
RCS file: /sources/public/html5/markup-spec/tools/generate-spec-source.xsl,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- generate-spec-source.xsl 30 Apr 2009 10:40:49 -0000 1.167
+++ generate-spec-source.xsl 1 May 2009 07:01:21 -0000 1.168
@@ -401,7 +401,7 @@
</xsl:for-each>
</section>
<xsl:text> </xsl:text>
- <section id="other-shared-attrs">
+ <section id="shared-attrs">
<xsl:text> </xsl:text>
<h2>Other shared attributes</h2>
<section id="common-command-attrs">
Index: specgen.xsl
===================================================================
RCS file: /sources/public/html5/markup-spec/tools/specgen.xsl,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- specgen.xsl 25 Dec 2008 08:18:01 -0000 1.25
+++ specgen.xsl 1 May 2009 07:01:22 -0000 1.26
@@ -11,6 +11,13 @@
media-type='text/html; charset=us-ascii'
indent="yes"/>
+ <xsl:include href="chunker.xsl"/>
+ <xsl:param name="chunk" select="0"/>
+
+ <xsl:key name="id" match="*" use="@id"/>
+ <xsl:key name="chunk-for-id" match="*[@id]" use="ancestor::h:section[child::h:h2[@class='element-head']]
+ |ancestor::h:section[(count(ancestor::h:section)=0 and not(@id='elements'))]"/>
+
<xsl:variable name='sectionsID'>this_sections</xsl:variable>
<xsl:variable name='appendicesID'>appendices</xsl:variable>
@@ -27,12 +34,12 @@
<xsl:variable name="groupinfo-nodeset" select="$info/h:*[@id = 'groupinfo']"/>
<xsl:template match='/'>
- <xsl:if test='$maturity = "ED"'>
- <xsl:comment> * </xsl:comment>
- <xsl:comment> * Note: This file was generated from source at <xsl:value-of select="$source"/><xsl:text> </xsl:text></xsl:comment>
- <xsl:comment> * Run the "make" command to regenerate it. </xsl:comment>
- <xsl:comment> * </xsl:comment>
- </xsl:if>
+ <!-- * <xsl:if test='$maturity = "ED"'> -->
+ <!-- * <xsl:comment> * </xsl:comment> -->
+ <!-- * <xsl:comment> * Note: This file was generated from source at <xsl:value-of select="$source"/><xsl:text> </xsl:text></xsl:comment> -->
+ <!-- * <xsl:comment> * Run the "make" command to regenerate it. </xsl:comment> -->
+ <!-- * <xsl:comment> * </xsl:comment> -->
+ <!-- * </xsl:if> -->
<xsl:apply-templates select='/*'/>
</xsl:template>
@@ -597,13 +604,71 @@
<!-- * </xsl:template> -->
<xsl:template match='h:section'>
- <div>
- <xsl:copy-of select='@*[namespace-uri()="" or namespace-uri="http://www.w3.org/XML/1998/namespace"]'/>
- <xsl:attribute name="class">section</xsl:attribute>
- <xsl:apply-templates select='node()'/>
- </div>
+ <xsl:variable name="content">
+ <div>
+ <xsl:copy-of select='@*[namespace-uri()="" or namespace-uri="http://www.w3.org/XML/1998/namespace"]'/>
+ <xsl:attribute name="class">section</xsl:attribute>
+ <xsl:apply-templates select='node()'/>
+ </div>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="not($chunk=0) and (count(ancestor::h:section)=0 or child::h:h2[@class='element-head'])">
+ <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="normalize-space(h:h2)"/>
+ <xsl:with-param name="filename">
+ <xsl:value-of select="@id"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$content"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match='*'/>
-</xsl:stylesheet>
+ <xsl:template match="h:a[@href[starts-with(.,'#')]]">
+ <!-- * href ID references in chunked output need to become intra-file -->
+ <!-- * references to IDs that are to targets in other files; so this -->
+ <!-- * template prepends the correct file name to all "bare" -->
+ <!-- * (filename-less) fragment href ID references -->
+ <xsl:choose>
+ <xsl:when test="not($chunk=0)">
+ <xsl:variable name="href" select="substring-after(@href,'#')"/>
+ <xsl:variable name="section"
+ select="key('id',$href)/ancestor-or-self::h:section[child::h:h2[@class='element-head']]
+ |key('id',$href)/ancestor::h:section[(count(ancestor::h:section)=0 and not(@id='elements'))]
+ "/>
+ <xsl:if test="not($section/@id)">
+ <xsl:message>
+ <xsl:text>UNDEFINED: </xsl:text>
+ <xsl:value-of select="$href"/>
+ <xsl:text> in </xsl:text>
+ <xsl:value-of select="ancestor::h:section[child::h:h2[@class='element-head']]/@id
+ |ancestor::h:section[(count(ancestor::h:section)=0 and not(@id='elements'))]/@id"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ <a>
+ <xsl:copy-of select="@*"/>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat($section/@id,'.html')"/>
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+</xsl:stylesheet>
Received on Friday, 1 May 2009 07:01:36 UTC