]> granicus.if.org Git - docbook-dsssl/commitdiff
Old profiling stylesheet moved to new location. Old stylesheet issues warning when...
authorJirka Kosek <jirka@kosek.cz>
Sun, 3 Mar 2002 19:39:03 +0000 (19:39 +0000)
committerJirka Kosek <jirka@kosek.cz>
Sun, 3 Mar 2002 19:39:03 +0000 (19:39 +0000)
xsl/profiling/profile.xsl [new file with mode: 0644]
xsl/tools/profile/profile.xsl

diff --git a/xsl/profiling/profile.xsl b/xsl/profiling/profile.xsl
new file mode 100644 (file)
index 0000000..69f3655
--- /dev/null
@@ -0,0 +1,34 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+<!-- Include common profiling stylesheet -->
+<xsl:include href="profile-mode.xsl"/>
+
+<!-- Generate DocBook instance with correct DOCTYPE -->
+<xsl:output method="xml" 
+            doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN"
+            doctype-system="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"/>
+
+<!-- Profiling parameters -->
+<xsl:param name="profile.arch" select="''"/>
+<xsl:param name="profile.condition" select="''"/>
+<xsl:param name="profile.conformance" select="''"/>
+<xsl:param name="profile.lang" select="''"/>
+<xsl:param name="profile.os" select="''"/>
+<xsl:param name="profile.revision" select="''"/>
+<xsl:param name="profile.revisionflag" select="''"/>
+<xsl:param name="profile.role" select="''"/>
+<xsl:param name="profile.security" select="''"/>
+<xsl:param name="profile.userlevel" select="''"/>
+<xsl:param name="profile.vendor" select="''"/>
+<xsl:param name="profile.attribute" select="''"/>
+<xsl:param name="profile.value" select="''"/>
+<xsl:param name="profile.separator" select="';'"/>
+
+<!-- Call common profiling mode -->
+<xsl:template match="/">
+  <xsl:apply-templates select="." mode="profile"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
index e39bad3a584558b1cdf05d9e50fd57ff21835072..571c355bc3a1a7faaabee1d075f7562dac0a13ab 100644 (file)
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version="1.0">
 
-<!-- Generate DocBook instance with correct DOCTYPE -->
-<xsl:output method="xml" 
-            doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN"
-            doctype-system="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"/>
-
-<!-- Which OSes to select -->
-<xsl:param name="os"/>
-
-<!-- Which UserLevels to select -->
-<xsl:param name="ul"/>
-
-<!-- Which Archs to select -->
-<xsl:param name="arch"/>
-
-<!-- Name of attribute with profiling information -->
-<xsl:param name="attr"/>
-
-<!-- Which $attrs to select -->
-<xsl:param name="val"/>
-
-<!-- Seperator for profiling values -->
-<xsl:param name="sep" select="';'"/>  
-
-<!-- Copy all non-element nodes -->
-<xsl:template match="@*|text()|comment()|processing-instruction()">
-  <xsl:copy/>
-</xsl:template>
-
-<!-- Profile elements based on input parameters -->
-<xsl:template match="*">
-  <xsl:variable name="os.content">
-    <xsl:if test="@os">
-      <xsl:call-template name="cross.compare">
-        <xsl:with-param name="a" select="$os"/>
-        <xsl:with-param name="b" select="@os"/>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:variable>
-  <xsl:variable name="os.ok" select="not(@os) or not($os) or
-                                     $os.content != '' or @os = ''"/>
-
-  <xsl:variable name="ul.content">
-    <xsl:if test="@userlevel">
-      <xsl:call-template name="cross.compare">
-        <xsl:with-param name="a" select="$ul"/>
-        <xsl:with-param name="b" select="@userlevel"/>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:variable>
-  <xsl:variable name="ul.ok" select="not(@userlevel) or not($ul) or
-                                     $ul.content != '' or @userlevel = ''"/>
-
-  <xsl:variable name="arch.content">
-    <xsl:if test="@arch">
-      <xsl:call-template name="cross.compare">
-        <xsl:with-param name="a" select="$arch"/>
-        <xsl:with-param name="b" select="@arch"/>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:variable>
-  <xsl:variable name="arch.ok" select="not(@arch) or not($arch) or
-                                       $arch.content != '' or @arch = ''"/>
-
-  <xsl:variable name="attr.content">
-    <xsl:if test="@*[local-name()=$attr]">
-      <xsl:call-template name="cross.compare">
-        <xsl:with-param name="a" select="$val"/>
-        <xsl:with-param name="b" select="@*[local-name()=$attr]"/>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:variable>
-  <xsl:variable name="attr.ok" select="not(@*[local-name()=$attr]) or not($val) or
-                                       $attr.content != '' 
-                                       or @*[local-name()=$attr] = '' or not($attr)"/>
-
-  <xsl:if test="$os.ok and $ul.ok and $arch.ok and $attr.ok">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-  </xsl:if>
-</xsl:template>
-
-<!-- Returns non-empty string if list in $b contains one ore more values from list $a -->
-<xsl:template name="cross.compare">
-  <xsl:param name="a"/>
-  <xsl:param name="b"/>
-  <xsl:param name="head" select="substring-before(concat($a, $sep), $sep)"/>
-  <xsl:param name="tail" select="substring-after($a, $sep)"/>
-  <xsl:if test="contains(concat($sep, $b, $sep), concat($sep, $head, $sep))">1</xsl:if>
-  <xsl:if test="$tail">
-    <xsl:call-template name="cross.compare">
-      <xsl:with-param name="a" select="$tail"/>
-      <xsl:with-param name="b" select="$b"/>
-    </xsl:call-template>
-  </xsl:if>
+<xsl:template match="/">
+  <xsl:message terminate="yes">WARNING:
+Profiling stylesheet has moved to new location profiling/profile.xsl.
+This new version uses different names of parameters. Please use e.g.
+"profile.os" instead of simply "os". You can now also perform
+profiling in a single step as an integral part of transformation. Check
+new stylesheets profile-docbook.xsl and profile-chunk.xsl.
+  </xsl:message>  
 </xsl:template>
 
 </xsl:stylesheet>