From: Norman W. <nw...@us...> - 2004-01-09 15:56:08
|
Update of /cvsroot/docbook/docbook/relaxng/tools In directory sc8-pr-cvs1:/tmp/cvs-serv20836 Modified Files: rngdocxml-multipass.xsl Log Message: Flatten groups of optional attributes Index: rngdocxml-multipass.xsl =================================================================== RCS file: /cvsroot/docbook/docbook/relaxng/tools/rngdocxml-multipass.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- rngdocxml-multipass.xsl 9 Jan 2004 13:09:43 -0000 1.2 +++ rngdocxml-multipass.xsl 9 Jan 2004 15:56:04 -0000 1.3 @@ -333,4 +333,19 @@ </xsl:template> + <xsl:template match="rng:group" mode="flatten"> + <xsl:choose> + <xsl:when test="ancestor::doc:attributes + and count(*) = count(rng:optional[rng:attribute])"> + <xsl:apply-templates mode="flatten"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:copy-of select="@*"/> + <xsl:apply-templates mode="flatten"/> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + <xsl:template match="doc:content-model//rng:choice/rng:choice |doc:content-model//rng:zeroOrMore/rng:choice |