1 <!-- Generate complaints if the schema is invalid in some way. --> 2 3 <!-- 4 // This file is part of TagSoup and is Copyright 2002-2008 by John Cowan. 5 // 6 // TagSoup is licensed under the Apache License, 7 // Version 2.0. You may obtain a copy of this license at 8 // http://www.apache.org/licenses/LICENSE-2.0 . You may also have 9 // additional legal rights not granted by this license. 10 // 11 // TagSoup is distributed in the hope that it will be useful, but 12 // unless required by applicable law or agreed to in writing, TagSoup 13 // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 14 // OF ANY KIND, either express or implied; not even the implied warranty 15 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 --> 17 18 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 19 xmlns:tssl="http://www.ccil.org/~cowan/XML/tagsoup/tssl" 20 version="1.0"> 21 22 <xsl:output method="text"/> 23 24 <xsl:strip-space elements="*"/> 25 26 <!-- Generates a report if an element does not belong to at least 27 one of the groups that its parent element contains. --> 28 <xsl:template match="tssl:element/tssl:element"> 29 <xsl:if test="not(tssl:memberOfAny) and not(tssl:memberOf/@group = ../tssl:contains/@group)"> 30 <xsl:value-of select="@name"/> 31 <xsl:text> is not in the content model of </xsl:text> 32 <xsl:value-of select="../@name"/> 33 <xsl:text>
</xsl:text> 34 </xsl:if> 35 <xsl:apply-templates/> 36 </xsl:template> 37 38 39 40 </xsl:transform> 41