jakarta-site-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r219258 - /jakarta/site/xdocs/stylesheets/sitechk.xsl
Date Fri, 15 Jul 2005 23:01:26 GMT
Author: sebb
Date: Fri Jul 15 16:01:26 2005
New Revision: 219258

URL: http://svn.apache.org/viewcvs?rev=219258&view=rev
Log:
XSL to check for tags with more than one attribute

Added:
    jakarta/site/xdocs/stylesheets/sitechk.xsl   (with props)

Added: jakarta/site/xdocs/stylesheets/sitechk.xsl
URL: http://svn.apache.org/viewcvs/jakarta/site/xdocs/stylesheets/sitechk.xsl?rev=219258&view=auto
==============================================================================
--- jakarta/site/xdocs/stylesheets/sitechk.xsl (added)
+++ jakarta/site/xdocs/stylesheets/sitechk.xsl Fri Jul 15 16:01:26 2005
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<!--
+	Generate a warning if any node contains more than 1 attribute
+-->
+ <xsl:template match="node()">
+  <!-- xsl nodes can contain multiple attributes -->
+  <xsl:if test="not(starts-with(name(),'xsl:'))">
+   <xsl:if test="count(@*)>1">
+    <xsl:message terminate = "no">
+    <xsl:value-of select="name()"/> tag contains <xsl:value-of select="count(@*)"/>
attributes</xsl:message>
+   </xsl:if>
+  </xsl:if>
+  <xsl:apply-templates/>
+ </xsl:template>
+
+</xsl:stylesheet>

Propchange: jakarta/site/xdocs/stylesheets/sitechk.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: site-cvs-help@jakarta.apache.org


Mime
View raw message