- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 04 Feb 2010 15:09:25 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/markup/tools
In directory hutz:/tmp/cvs-serv2080/tools
Modified Files:
Output.java generate-spec-source.xsl specgen.xsl trang.jar
Log Message:
checkpointing; reverted to generating content models from schema, but with translation of RNC syntax to natural language
Index: Output.java
===================================================================
RCS file: /sources/public/html5/markup/tools/Output.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Output.java 30 Jan 2010 04:44:26 -0000 1.3
+++ Output.java 4 Feb 2010 15:09:22 -0000 1.4
@@ -232,7 +232,7 @@
literal(ns);
pp.endNest();
pp.endGroup();
- pp.text("</div>");
+ pp.text("</span>");
pp.hardNewline();
needNewline = true;
}
@@ -673,12 +673,12 @@
pp.text(op);
}
else {
- pp.text("(");
- pp.startNest("(");
+ pp.text(" <span class='agroupof'>");
+ pp.startNest("<span class='agroupof'>");
p.getChild().accept(patternOutput);
pp.endNest();
pp.text(op);
- pp.text(")");
+ pp.text("</span>");
}
endAnnotations(p);
}
@@ -829,7 +829,7 @@
}
public VoidValue visitInterleave(InterleavePattern p) {
- composite(p, " <span class='postfix &'>&</span> ", false);
+ composite(p, " <span class='postfix intermixed'>intermixed with</span> ", false);
return VoidValue.VOID;
}
@@ -846,8 +846,8 @@
if (isSimple)
pp.startGroup();
if (useParens) {
- pp.text("(");
- pp.startNest("(");
+ pp.text(" <span class='agroupof'>");
+ pp.startNest("<span class='agroupof'>");
}
boolean first = true;
@@ -872,7 +872,7 @@
}
if (useParens) {
pp.endNest();
- pp.text(")");
+ pp.text("</span>");
}
if (isSimple)
pp.endGroup();
@@ -1040,8 +1040,8 @@
else if (nc.getChildren().size() == 1)
useParens = false;
if (useParens) {
- pp.text("(");
- pp.startNest("(");
+ pp.text(" <span class='agroupof'>");
+ pp.startNest("<span class='agroupof'>");
}
pp.startGroup();
boolean first = true;
@@ -1057,7 +1057,7 @@
pp.endGroup();
if (useParens) {
pp.endNest();
- pp.text(")");
+ pp.text("</span>");
}
endAnnotations(nc);
return VoidValue.VOID;
@@ -1296,9 +1296,9 @@
int idx = escaped.lastIndexOf("&");
if ( idx != -1 ) {
StringBuffer ret_amp = new StringBuffer(str);
- ret_amp.replace(idx, idx+1, " <span class='postfix &' title='INTERLEAVED IN ANY ORDER'>&</span> ");
+ ret_amp.replace(idx, idx+1, " <span class='postfix intermixed'>intermixed with</span> ");
while( (idx=str.lastIndexOf("&", idx-1)) != -1 ) {
- ret_amp.replace(idx, idx+1, " <span class='postfix &' title='INTERLEAVED IN ANY ORDER'>&</span> ");
+ ret_amp.replace(idx, idx+1, " <span class='postfix intermixed'>intermixed with</span> ");
}
escaped = ret_amp.toString();
}
Index: specgen.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/specgen.xsl,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- specgen.xsl 3 Feb 2010 14:44:07 -0000 1.48
+++ specgen.xsl 4 Feb 2010 15:09:23 -0000 1.49
@@ -647,11 +647,38 @@
</xsl:choose>
</xsl:template>
<xsl:template match='*'/>
- <xsl:template match="h:a[@href[starts-with(.,'#')]]">
+ <xsl:template match="h:a[@href[starts-with(.,'#')]]" name="link-handler">
<!-- * 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:if test="ancestor::*[@class='content-models']
+ and not(ancestor::*[@id='common-models'])
+ and not(@href='#normal-character-data')
+ and not(@href='#phrasing-content')
+ and not(@href='#flow-content')
+ and not(starts-with(@href,'#common.'))
+ ">
+ <xsl:choose>
+ <xsl:when test="following-sibling::*[1][@class='postfix zeroormore']">
+ <span>zero or more </span>
+ </xsl:when>
+ <xsl:when test="following-sibling::*[1][@class='postfix optional']">
+ <span>an optional </span>
+ </xsl:when>
+ <xsl:when test="following-sibling::*[1][@class='postfix oneormore']">
+ <span>one or more </span>
+ </xsl:when>
+ <xsl:when test="ancestor::*[@class='agroupof']
+ ">
+ <span>one </span>
+ </xsl:when>
+ <xsl:when test="following-sibling::*
+ ">
+ <span>one </span>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
<xsl:choose>
<xsl:when test="not($chunk=0)">
<xsl:variable name="href" select="substring-after(@href,'#')"/>
@@ -660,6 +687,10 @@
|key('id',$href)/ancestor::h:section[(count(ancestor::h:section)=0 and not(@id='elements'))]
"/>
<xsl:choose>
+ <xsl:when test="preceding-sibling::h:span[@class='postfix intermixed']
+ and ancestor::*[@class='elem-mdl']
+ and contains($href,'.attrs')
+ "/>
<xsl:when test="$href='syntax'">
<a>
<xsl:copy-of select="@*"/>
@@ -765,6 +796,64 @@
">
<span class="postfix required" title="REQUIRED">★</span>
</xsl:if>
+ <xsl:if test="ancestor::*[@class='content-models']
+ and not(ancestor::*[@id='common-models'])
+ and not(@href='#normal-character-data')
+ and not(@href='#phrasing-content')
+ and not(@href='#flow-content')
+ and not(starts-with(@href,'#common.'))
+ ">
+ <xsl:choose>
+ <xsl:when test="
+ ancestor::h:*[@class='content-models']
+ and following-sibling::*[1][self::h:*[contains(@class,'zeroormore')]]
+ ">
+ <span> elements</span>
+ <xsl:if test="following-sibling::*[not(contains(@class,'postfix'))][not(contains(.,'.attrs'))]">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="
+ ancestor::h:*[@class='content-models']
+ and following-sibling::*[1][self::h:*[contains(@class,'optional')]]
+ ">
+ <xsl:choose>
+ <xsl:when test="contains(@href,'.attrs.')">
+ <span> attribute</span>
+ </xsl:when>
+ <xsl:otherwise>
+ <span> element</span>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="following-sibling::*[not(contains(@class,'postfix'))][not(contains(.,'.attrs'))]">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="
+ ancestor::h:*[@class='content-models']
+ and following-sibling::*[1][self::h:*[contains(@class,'oneormore')]]
+ ">
+ <span> elements</span>
+ <xsl:if test="following-sibling::*[not(contains(@class,'postfix'))][not(contains(.,'.attrs'))]">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="ancestor::*[@class='agroupof']
+ ">
+ <span> element</span>
+ <xsl:if test="following-sibling::*[not(contains(@class,'postfix'))][not(contains(.,'.attrs'))]">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="following-sibling::*
+ ">
+ <span> element</span>
+ <xsl:if test="following-sibling::*[not(contains(@class,'postfix'))][not(contains(.,'.attrs'))]">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
</xsl:template>
<xsl:template match="h:div[@id='tocjump']">
<div id="tocjump" class="skip-link" style="text-align: center">
@@ -793,4 +882,135 @@
</xsl:choose>
</div>
</xsl:template>
+ <xsl:template match="h:span[@class='agroupof']
+ [following-sibling::*[1][@class='postfix zeroormore']]
+ [ancestor::*[@class='content-models']]
+ ">
+ <span>zero or more of: </span>
+ <span class="agroupof">
+ <xsl:apply-templates/>
+ </span>
+ <xsl:text> </xsl:text>
+ </xsl:template>
+ <xsl:template match="h:span[@class='agroupof']
+ [following-sibling::*[1][@class='postfix optional']]
+ [ancestor::*[@class='content-models']]
+ ">
+ <span>optionally: </span>
+ <span class="agroupof">
+ <xsl:apply-templates/>
+ </span>
+ <xsl:text> </xsl:text>
+ </xsl:template>
+ <xsl:template match="h:span[@class='agroupof']
+ [following-sibling::*[1][@class='postfix oneormore']]
+ [ancestor::*[@class='content-models']]
+ ">
+ <span>one or more of: </span>
+ <span class="agroupof">
+ <xsl:apply-templates/>
+ </span>
+ <xsl:text> </xsl:text>
+ </xsl:template>
+ <xsl:template match="h:span[@class='postfix zeroormore']"/>
+ <xsl:template match="h:span[@class='postfix optional']"/>
+ <xsl:template match="h:span[@class='postfix oneormore']"/>
+ <xsl:template match="h:span[@class='postfix intermixed']">
+ <xsl:choose>
+ <xsl:when test="following-sibling::h:*[1][self::h:a[contains(@href,'.attrs')]]
+ and ancestor::*[@class='elem-mdl']
+ "/>
+ <xsl:when test="ancestor::*[@class='attr-content-models']">
+ <span class="postfix intermixed">&</span>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#phrasing-content']]]
+ [following-sibling::*[1][@class='postfix or']
+ [following-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#flow-content']]]
+ ]
+ ]
+ ]
+ ">
+ <xsl:call-template name="transparent"/>
+ </xsl:template>
+ <xsl:template match="h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#flow-content']]]
+ [following-sibling::*[1][@class='postfix or']
+ [following-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#phrasing-content']]]
+ ]
+ ]
+ ]
+ ">
+ <xsl:call-template name="transparent"/>
+ </xsl:template>
+ <xsl:template match="h:*[@class='postfix or']
+ [preceding-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#flow-content']]]
+ ]
+ ]
+ [following-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#phrasing-content']]]
+ ]
+ ]
+ "/>
+ <xsl:template match="h:*[@class='postfix or']
+ [preceding-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#phrasing-content']]]
+ ]
+ ]
+ [following-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#flow-content']]]
+ ]
+ ]
+ "/>
+ <xsl:template match="h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#phrasing-content']]]
+ [preceding-sibling::*[1][@class='postfix or']
+ [preceding-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#flow-content']]]
+ ]
+ ]
+ ]
+ "/>
+ <xsl:template match="h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#flow-content']]]
+ [preceding-sibling::*[1][@class='postfix or']
+ [preceding-sibling::*[1]
+ [self::h:*[@class='elem-mdl']
+ [child::*[1][self::h:a[@href='#phrasing-content']]]
+ ]
+ ]
+ ]
+ "/>
+ <xsl:template name="transparent">
+ <xsl:variable name="terminology.html">
+ <xsl:if test="$chunk=1">terminology.html</xsl:if>
+ </xsl:variable>
+ <p class="elem-mdl"><span class="transparent"><a href="{$terminology.html}#transparent">transparent</a>
+ <xsl:text> (</xsl:text>
+ <span class="postfix or">either</span>
+ <xsl:text> </xsl:text>
+ <a href="{$terminology.html}#phrasing-content">phrasing content</a>
+ <xsl:text> </xsl:text>
+ <span class="postfix or">or</span>
+ <xsl:text> </xsl:text>
+ <a href="{$terminology.html}#phrasing-content">flow content</a>
+ <xsl:text>)</xsl:text>
+ </span>
+ </p>
+ </xsl:template>
</xsl:stylesheet>
Index: generate-spec-source.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/generate-spec-source.xsl,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -d -r1.228 -r1.229
--- generate-spec-source.xsl 3 Feb 2010 14:44:07 -0000 1.228
+++ generate-spec-source.xsl 4 Feb 2010 15:09:23 -0000 1.229
@@ -1280,7 +1280,8 @@
<xsl:param name="name"/>
<xsl:param name="name-dot" select="concat($name, '.')"/>
<xsl:if
- test="document(concat('../elements/',$name,'.html'))//h:div[@id='prose-model']">
+ test="document(concat('../elements/',$name,'.html'))//h:div[@id='prose-model']
+ and $show-content-models = 0">
<div class="no-number no-toc" id="{$name}-contents">
<h2 class="element-subhead">Permitted content</h2>
<div class="prose-model">
@@ -1321,7 +1322,7 @@
<xsl:if test="not($show-content-models = 0)">
<div class="no-number no-toc" id="{$name}-content-model">
<xsl:text> </xsl:text>
- <h2 class="element-subhead">Content model</h2>
+ <h2 class="element-subhead">Permitted content</h2>
<div class="content-models">
<xsl:text> </xsl:text>
<xsl:variable name="count">
@@ -1339,7 +1340,8 @@
<xsl:variable name="wrapper">
<xsl:choose>
<xsl:when test="$count > 1">
- <xsl:text>dl</xsl:text>
+ <!-- * <xsl:text>dl</xsl:text> -->
+ <xsl:text>div</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>div</xsl:text>
@@ -1385,6 +1387,9 @@
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="pname" select="$pname"/>
</xsl:call-template>
+ <xsl:if test="not(position() = last())">
+ <div class="postfix or">or</div>
+ </xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
@@ -1397,6 +1402,9 @@
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="pname" select="$pname"/>
</xsl:call-template>
+ <xsl:if test="not(position() = last())">
+ <div class="postfix or">or</div>
+ </xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
@@ -1594,50 +1602,50 @@
<xsl:param name="pname"/>
<xsl:text> </xsl:text>
<xsl:if test="$count > 1">
- <dt class="content-model">
- <xsl:variable name="myname">
- <xsl:choose>
- <xsl:when test="not($pname = $name)">
- <xsl:value-of select="$pname"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- * we get here for li, source, and style -->
- <xsl:value-of select="concat($pname,'-pattern')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <span class="element-pattern-name" id="{$myname}">
- <a class="hash" href="#{$myname}">
- <xsl:choose>
- <xsl:when test="$pname='oli'">
- <xsl:text>o</xsl:text><span class="element">li</span>
- </xsl:when>
- <xsl:when test="$pname='mli'">
- <xsl:text>m</xsl:text><span class="element">li</span>
- </xsl:when>
- <xsl:when test="contains($pname,'.')">
- <span class="element">
- <xsl:value-of select="substring-before($pname,'.')"/>
- </span>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="substring-after($pname,'.')"/>
- </xsl:when>
- <xsl:otherwise>
- <span class="element">
- <xsl:value-of select="$pname"/>
- </span>
- </xsl:otherwise>
- </xsl:choose>
- </a>
- <xsl:text> = </xsl:text>
- </span>
- </dt>
+ <!-- * <dt class="content-model"> -->
+ <!-- * <xsl:variable name="myname"> -->
+ <!-- * <xsl:choose> -->
+ <!-- * <xsl:when test="not($pname = $name)"> -->
+ <!-- * <xsl:value-of select="$pname"/> -->
+ <!-- * </xsl:when> -->
+ <!-- * <xsl:otherwise> -->
+ <!-- * <xsl:value-of select="concat($pname,'-pattern')"/> -->
+ <!-- * </xsl:otherwise> -->
+ <!-- * </xsl:choose> -->
+ <!-- * </xsl:variable> -->
+ <!-- * <span class="element-pattern-name" id="{$myname}"> -->
+ <!-- * <a class="hash" href="#{$myname}"> -->
+ <!-- * <xsl:choose> -->
+ <!-- * <xsl:when test="$pname='oli'"> -->
+ <!-- * <xsl:text>o</xsl:text><span class="element">li</span> -->
+ <!-- * </xsl:when> -->
+ <!-- * <xsl:when test="$pname='mli'"> -->
+ <!-- * <xsl:text>m</xsl:text><span class="element">li</span> -->
+ <!-- * </xsl:when> -->
+ <!-- * <xsl:when test="contains($pname,'.')"> -->
+ <!-- * <span class="element"> -->
+ <!-- * <xsl:value-of select="substring-before($pname,'.')"/> -->
+ <!-- * </span> -->
+ <!-- * <xsl:text>.</xsl:text> -->
+ <!-- * <xsl:value-of select="substring-after($pname,'.')"/> -->
+ <!-- * </xsl:when> -->
+ <!-- * <xsl:otherwise> -->
+ <!-- * <span class="element"> -->
+ <!-- * <xsl:value-of select="$pname"/> -->
+ <!-- * </span> -->
+ <!-- * </xsl:otherwise> -->
+ <!-- * </xsl:choose> -->
+ <!-- * </a> -->
+ <!-- * <xsl:text> = </xsl:text> -->
+ <!-- * </span> -->
+ <!-- * </dt> -->
<xsl:text> </xsl:text>
</xsl:if>
<xsl:variable name="wrapper">
<xsl:choose>
<xsl:when test="$count > 1">
- <xsl:text>dd</xsl:text>
+ <!-- * <xsl:text>dd</xsl:text> -->
+ <xsl:text>p</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>p</xsl:text>
@@ -1646,30 +1654,28 @@
</xsl:variable>
<xsl:element name="{$wrapper}">
<xsl:attribute name="class">elem-mdl</xsl:attribute>
- <xsl:if test="not($count > 1)">
- <span class="element-pattern-name">
- <xsl:choose>
- <xsl:when test="contains($name,'.')">
- <a id="{$name}-mdl" href="#{$name}-mdl">
- <span class="element">
- <xsl:value-of select="substring-before($name,'.')"/>
- </span>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="substring-after($name,'.')"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <a id="{$name}-mdl" href="#{$name}-mdl" class="element">
- <xsl:value-of select="$name"/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> = </xsl:text>
- </span>
- </xsl:if>
- <xsl:copy>
- <xsl:apply-templates/>
- </xsl:copy>
+ <!-- * <xsl:if test="not($count > 1)"> -->
+ <!-- * <span class="element-pattern-name"> -->
+ <!-- * <xsl:choose> -->
+ <!-- * <xsl:when test="contains($name,'.')"> -->
+ <!-- * <a id="{$name}-mdl" href="#{$name}-mdl"> -->
+ <!-- * <span class="element"> -->
+ <!-- * <xsl:value-of select="substring-before($name,'.')"/> -->
+ <!-- * </span> -->
+ <!-- * <xsl:text>.</xsl:text> -->
+ <!-- * <xsl:value-of select="substring-after($name,'.')"/> -->
+ <!-- * </a> -->
+ <!-- * </xsl:when> -->
+ <!-- * <xsl:otherwise> -->
+ <!-- * <a id="{$name}-mdl" href="#{$name}-mdl" class="element"> -->
+ <!-- * <xsl:value-of select="$name"/> -->
+ <!-- * </a> -->
+ <!-- * </xsl:otherwise> -->
+ <!-- * </xsl:choose> -->
+ <!-- * <xsl:text> = </xsl:text> -->
+ <!-- * </span> -->
+ <!-- * </xsl:if> -->
+ <xsl:apply-templates/>
</xsl:element>
</xsl:template>
@@ -1808,38 +1814,19 @@
</xsl:when>
<xsl:when test="@name='colgroup'">
<div class="attr-content-models">
- <xsl:for-each
- select="document($rnc-html)//*[@class='pattern'][starts-with(@id,'colgroup.attrs')]">
- <div class="attr-content-model">
- <!-- * <xsl:choose> -->
- <!-- * <xsl:when test="@id='colgroup.attrs.span'"> -->
- <!-- * <a class="attribute-pattern-name" -->
- <!-- * id="{@id}-mdl" -->
- <!-- * href="#{@id}-mdl" -->
- <!-- * > -->
- <!-- * <xsl:value-of select="@id"/> -->
- <!-- * </a> -->
- <!-- * </xsl:when> -->
- <!-- * <xsl:otherwise> -->
- <!-- * <a class="attribute-pattern-name" -->
- <!-- * id="{@id}" -->
- <!-- * href="#{@id}" -->
- <!-- * > -->
- <!-- * <xsl:value-of select="@id"/> -->
- <!-- * </a> -->
- <!-- * </xsl:otherwise> -->
- <!-- * </xsl:choose> -->
- <!-- * <xsl:text> = </xsl:text> -->
- <xsl:choose>
- <xsl:when test="@id='colgroup.attrs.span'">
- <a href='#colgroup.attrs.span'>span</a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </xsl:for-each>
+ <p>
+ <span class="pattern" id="colgroup.attrs">
+ <a href="#common-attributes">common attributes</a>
+ <span class="postfix optional">?</span>
+ <xsl:text> </xsl:text>
+ <span class="postfix intermixed">&</span>
+ <xsl:text> </xsl:text>
+ <span class="postfix optional">?</span>
+ <xsl:text> </xsl:text>
+ <a href="#colgroup.attrs.span">span</a>
+ <span class="postfix optional">?</span>
+ </span>
+ </p>
</div>
</xsl:when>
<xsl:when test="@name='area'">
@@ -1903,53 +1890,39 @@
<!-- * <xsl:value-of select="@id"/> -->
<!-- * </a> -->
<!-- * <xsl:text> = </xsl:text> -->
- <xsl:choose>
- <xsl:when test="starts-with(@id,'button.')
- or starts-with(@id,'input.')
- or starts-with(@id,'command.')
- or starts-with(@id,'meta.')
- or starts-with(@id,'source.')
- or starts-with(@id,'style.')
- ">
- <xsl:variable name="ref" select="@id"/>
- <span class="pattern" id="{@id}">
- <xsl:choose>
- <xsl:when test="document($rnc-html)//h:*[@id = $ref]//h:a[@href='#common-form.attrs']">
- <xsl:for-each select="document($rnc-html)//h:*[@id = $ref]/node()">
- <xsl:choose>
- <xsl:when test=". = 'common-form.attrs'">
- <xsl:for-each
- select="document($rnc-html)//h:*[@id = 'common-form.attrs']/node()">
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </span>
- </xsl:when>
- <xsl:otherwise>
<xsl:variable name="ref" select="@id"/>
<xsl:choose>
<xsl:when test="document($rnc-html)//h:*[@id = $ref]//h:a[@href='#common-form.attrs']">
<span class="pattern" id="{@id}">
<xsl:for-each select="document($rnc-html)//h:*[@id = $ref]/node()">
<xsl:choose>
- <xsl:when test=". = 'common-form.attrs'">
- <xsl:for-each
- select="document($rnc-html)//h:*[@id = 'common-form.attrs']/node()">
- <xsl:copy-of select="."/>
+ <xsl:when test="@class='agroupof'">
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="@href='#common-form.attrs'">
+ <xsl:for-each
+ select="document($rnc-html)//h:*[@id = 'common-form.attrs']/node()">
+ <xsl:copy-of select="."/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
- <xsl:copy-of select="."/>
+ <xsl:choose>
+ <xsl:when test="@href='#common-form.attrs'">
+ <xsl:for-each
+ select="document($rnc-html)//h:*[@id = 'common-form.attrs']/node()">
+ <xsl:copy-of select="."/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
@@ -1959,8 +1932,6 @@
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
</p>
<xsl:if test="not(position() = last())">
<span class="postfix or">or</span>
@@ -2523,12 +2494,10 @@
<!-- * special-case constraint of col element vs. span -->
<!-- * attribute in colgroup content model requires some -->
<!-- * additional finessing to make things clear -->
- <xsl:text>(</xsl:text>
<xsl:for-each select="//h:*[@id = $ref]/node()">
<xsl:choose>
<xsl:when test=".='span'">
- <a href="#colgroup.attrs.span-mdl">
- <span class="attr-qualifier">colgroup.attrs.</span>
+ <a href="#colgroup.attrs.span" class="attribute">
<xsl:text>span</xsl:text>
</a>
</xsl:when>
@@ -2537,7 +2506,6 @@
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
- <xsl:text>)</xsl:text>
</xsl:when>
<xsl:when test="$ref = 'ol.inner'">
<xsl:for-each select="//*[@id='ol.inner']/node()">
@@ -2601,19 +2569,19 @@
<!-- * * UTILITY TEMPLATES -->
<!-- * ***************************************************************** -->
<xsl:template name="garnish.as.needed">
- <!-- * add back parens where necessary -->
<xsl:choose>
- <xsl:when test=". = 'common.inner.flow'">
- <xsl:text>(</xsl:text>
- <xsl:copy-of
- select="//h:*[@id = 'common.inner.flow']/node()"/>
- <xsl:text>)</xsl:text>
+ <xsl:when test="@class='agroupof'">
+ <span class='agroupof'>
+ <xsl:for-each select="node()">
+ <xsl:call-template name="garnish.as.needed"/>
+ </xsl:for-each>
+ </span>
</xsl:when>
- <xsl:when test=". = 'common.inner.phrasing'">
- <xsl:text>(</xsl:text>
- <xsl:copy-of
- select="//h:*[@id = 'common.inner.phrasing']/node()"/>
- <xsl:text>)</xsl:text>
+ <xsl:when test="@href = '#common.inner.flow'">
+ <a href="#flow-content">flow content</a>
+ </xsl:when>
+ <xsl:when test="@href = '#common.inner.phrasing'">
+ <a href="#phrasing-content">phrasing content</a>
</xsl:when>
<xsl:when test=". = 'common.inner.anything'">
<xsl:text>(</xsl:text>
@@ -2622,10 +2590,7 @@
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:when test=". = 'common.inner.metadata'">
- <xsl:text>(</xsl:text>
- <xsl:copy-of
- select="//h:*[@id = 'common.inner.metadata']/node()"/>
- <xsl:text>)</xsl:text>
+ <a href="#common.elem.metadata">metadata elements</a>
</xsl:when>
<xsl:when test="@href='#audio.attrs.src'">
<a class="ref" href="{@href}">audio.attrs.src</a>
@@ -2707,7 +2672,10 @@
<!-- * <xsl:text> </xsl:text> -->
<!-- * </xsl:message> -->
- <xsl:template match="h:a[@class='rnc-symbol']">
+ <xsl:template match="h:span[@class='postfix intermixed']">
<xsl:copy-of select="."/>
</xsl:template>
+ <xsl:template match="node()[normalize-space(.)='empty']">
+ <span>empty (<a href="#void-element">void element</a>)</span>
+ </xsl:template>
</xsl:stylesheet>
Index: trang.jar
===================================================================
RCS file: /sources/public/html5/markup/tools/trang.jar,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
Binary files /tmp/cvs53KNLf and /tmp/cvsZhlHKR differ
Received on Thursday, 4 February 2010 15:09:27 UTC