#105581# check for sanity of xsl - validates info/desc elements for now

This commit is contained in:
tpf 2002-12-02 09:44:24 +00:00
parent 209115df3c
commit ea43e8bde7
2 changed files with 66 additions and 2 deletions

View file

@ -2,9 +2,9 @@
#
# $RCSfile: makefile.pmk,v $
#
# $Revision: 1.21 $
# $Revision: 1.22 $
#
# last change: $Author: tpf $ $Date: 2002-10-25 17:24:41 $
# last change: $Author: tpf $ $Date: 2002-12-02 10:44:24 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@ -69,6 +69,7 @@ $(MISC)$/registry$/schema$/%.xcs : %.xcs
-$(MKDIR) -p $(@:d)
$(JAVA) -classpath $(SOLARBINDIR)$/jaxp.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/parser.jar$(PATH_SEPERATOR)$(CLASSDIR)$/cfgimport.jar -Djavax.xml.parsers.SAXParserFactory=com.sun.xml.parser.SAXParserFactoryImpl org.openoffice.configuration.Inspector $<
$(JAVA) -classpath $(SOLARBINDIR)$/xt.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/parser.jar -Dcom.jclark.xsl.sax.parser=com.sun.xml.parser.Parser com.jclark.xsl.sax.Driver $< $(PRJ)$/util$/schema_val.xsl $(@:d)$(<:b).val file=$(<:d)$(<:b) pathSeparator=$/
$(JAVA) -classpath $(SOLARBINDIR)$/xt.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/parser.jar -Dcom.jclark.xsl.sax.parser=com.sun.xml.parser.Parser com.jclark.xsl.sax.Driver $< $(PRJ)$/util$/sanity.xsl $(@:d)$(<:b).san file=$(<:d)$(<:b) pathSeparator=$/
$(JAVA) -classpath $(SOLARBINDIR)$/xt.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/parser.jar -Dcom.jclark.xsl.sax.parser=com.sun.xml.parser.Parser com.jclark.xsl.sax.Driver $< $(PRJ)$/util$/schema_trim.xsl $(@:d)$(<:b).tmp
$(JAVA) -classpath $(SOLARBINDIR)$/jaxp.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/parser.jar$(PATH_SEPERATOR)$(CLASSDIR)$/schema.jar -Djavax.xml.parsers.SAXParserFactory=com.sun.xml.parser.SAXParserFactoryImpl org.openoffice.helper.PrettyPrinter $(@:d)$(<:b).tmp $(@:d)$(<:b).xcs
+$(RM) $(@:d)$(<:b).tmp > $(NULLDEV)

63
officecfg/util/sanity.xsl Normal file
View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:oor="http://openoffice.org/2001/registry"
version="1.0">
<xsl:output method="text" indent="no" encoding="ISO-8859-1"/>
<xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
<!-- match root -->
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<!-- match all elements that could possibly contain info/desc elements -->
<xsl:template match="group|set|node-ref|prop|enumeration|length|minLength|maxLength|minInclusive|maxInclusive|minExclusive|maxExclusive|whiteSpace">
<xsl:if test="not(info/desc)">
<!-- print TPF's path to current node -->
<xsl:message terminate="no">
<!-- print linefeed -->
<xsl:text>&#10;</xsl:text>
<xsl:text>WARNING: No info/desc element specified</xsl:text>
<!-- print linefeed -->
<xsl:text>&#10;</xsl:text>
<xsl:text> - path: </xsl:text>
<xsl:for-each select="ancestor-or-self::*"><xsl:text>/</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:choose>
<xsl:when test="@oor:name">[<xsl:value-of select="@oor:name"/>]</xsl:when>
<xsl:when test="@oor:value">[<xsl:value-of select="@oor:value"/>]</xsl:when>
</xsl:choose>
</xsl:for-each>
<!-- print linefeed -->
<xsl:text>&#10;</xsl:text>
<xsl:text> - author: </xsl:text>
<xsl:for-each select="ancestor-or-self::*">
<!-- print element name -->
<xsl:if test="info/author">
<!-- print arrow -->
<xsl:text>-></xsl:text>
<xsl:value-of select="info/author"/>
</xsl:if>
</xsl:for-each>
</xsl:message>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
</xsl:transform>