diff options
author | tpf <tpf@openoffice.org> | 2002-12-02 09:44:24 +0000 |
---|---|---|
committer | tpf <tpf@openoffice.org> | 2002-12-02 09:44:24 +0000 |
commit | ea43e8bde71f6b8d3d6e41ab774efbd0b0a40645 (patch) | |
tree | 536777c3d7324da2d7a7f4d959ad5cbc5c2b584a /officecfg/util | |
parent | 209115df3c8e695f98b705b350fe4b7073a8c8ca (diff) |
#105581# check for sanity of xsl - validates info/desc elements for now
Diffstat (limited to 'officecfg/util')
-rw-r--r-- | officecfg/util/makefile.pmk | 5 | ||||
-rw-r--r-- | officecfg/util/sanity.xsl | 63 |
2 files changed, 66 insertions, 2 deletions
diff --git a/officecfg/util/makefile.pmk b/officecfg/util/makefile.pmk index 2c6ea9e996c6..24cf91813526 100644 --- a/officecfg/util/makefile.pmk +++ b/officecfg/util/makefile.pmk @@ -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) diff --git a/officecfg/util/sanity.xsl b/officecfg/util/sanity.xsl new file mode 100644 index 000000000000..9ae56a8ee380 --- /dev/null +++ b/officecfg/util/sanity.xsl @@ -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> </xsl:text> + + <xsl:text>WARNING: No info/desc element specified</xsl:text> + + <!-- print linefeed --> + <xsl:text> </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> </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> |