Combine all boot build stuff in a single scons tool
[senf.git] / senfscons / functions.xsl
diff --git a/senfscons/functions.xsl b/senfscons/functions.xsl
deleted file mode 100644 (file)
index b711cc3..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0"?>\r
-<xsl:stylesheet \r
-  version="1.0"\r
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
-  xmlns:str="http://exslt.org/strings"\r
-  xmlns:func="http://exslt.org/functions"\r
-  xmlns:exsl="http://exslt.org/common"\r
-  extension-element-prefixes="str exsl func">\r
-  \r
-<func:function name="str:split">\r
-  <xsl:param name="string" select="''" />\r
-  <xsl:param name="pattern" select="' '" />\r
-  <xsl:choose>\r
-    <xsl:when test="not($string)">\r
-      <func:result select="/.." />\r
-    </xsl:when>\r
-    <xsl:when test="not(function-available('exsl:node-set'))">\r
-      <xsl:message terminate="yes">\r
-        ERROR: EXSLT - Functions implementation of str:split relies on exsl:node-set().\r
-      </xsl:message>\r
-    </xsl:when>\r
-    <xsl:otherwise>\r
-      <xsl:variable name="tokens">\r
-        <xsl:choose>\r
-          <xsl:when test="not($pattern)">\r
-            <xsl:call-template name="str:_split-characters">\r
-              <xsl:with-param name="string" select="$string" />\r
-            </xsl:call-template>\r
-          </xsl:when>\r
-          <xsl:otherwise>\r
-            <xsl:call-template name="str:_split-pattern">\r
-              <xsl:with-param name="string" select="$string" />\r
-              <xsl:with-param name="pattern" select="$pattern" />\r
-            </xsl:call-template>\r
-          </xsl:otherwise>\r
-        </xsl:choose>\r
-      </xsl:variable>\r
-      <func:result select="exsl:node-set($tokens)/token" />\r
-    </xsl:otherwise>\r
-  </xsl:choose>\r
-</func:function>\r
-\r
-<xsl:template name="str:_split-characters">\r
-  <xsl:param name="string" />\r
-  <xsl:if test="$string">\r
-    <token><xsl:value-of select="substring($string, 1, 1)" /></token>\r
-    <xsl:call-template name="str:_split-characters">\r
-      <xsl:with-param name="string" select="substring($string, 2)" />\r
-    </xsl:call-template>\r
-  </xsl:if>\r
-</xsl:template>\r
-\r
-<xsl:template name="str:_split-pattern">\r
-  <xsl:param name="string" />\r
-  <xsl:param name="pattern" />\r
-  <xsl:choose>\r
-    <xsl:when test="contains($string, $pattern)">\r
-      <xsl:if test="not(starts-with($string, $pattern))">\r
-        <token><xsl:value-of select="substring-before($string, $pattern)" /></token>\r
-      </xsl:if>\r
-      <xsl:call-template name="str:_split-pattern">\r
-        <xsl:with-param name="string" select="substring-after($string, $pattern)" />\r
-        <xsl:with-param name="pattern" select="$pattern" />\r
-      </xsl:call-template>\r
-    </xsl:when>\r
-    <xsl:otherwise>\r
-      <token><xsl:value-of select="$string" /></token>\r
-    </xsl:otherwise>\r
-  </xsl:choose>\r
-</xsl:template>\r
-\r
-  <!-- ==================================================================== -->\r
-  <!-- node-set str:replace(string,object,object)                           -->\r
-  <!--                                                                      -->\r
-  <!-- This implements the EXSLT str:replace function                       -->\r
-  <!--                                                                      -->\r
-  <!-- Copyright Jeni Tenison                                               -->\r
-  <!-- ==================================================================== -->\r
-\r
-  <func:function name="str:replace">\r
-     <xsl:param name="string" select="''" />\r
-     <xsl:param name="search" select="/.." />\r
-     <xsl:param name="replace" select="/.." />\r
-     <xsl:choose>\r
-        <xsl:when test="not($string)">\r
-          <func:result select="/.." />\r
-        </xsl:when>\r
-        <xsl:when test="function-available('exsl:node-set')">\r
-           <!-- this converts the search and replace arguments to node sets\r
-                if they are one of the other XPath types -->\r
-           <xsl:variable name="search-nodes-rtf">\r
-             <xsl:copy-of select="$search" />\r
-           </xsl:variable>\r
-           <xsl:variable name="replace-nodes-rtf">\r
-             <xsl:copy-of select="$replace" />\r
-           </xsl:variable>\r
-           <xsl:variable name="replacements-rtf">\r
-              <xsl:for-each select="exsl:node-set($search-nodes-rtf)/node()">\r
-                 <xsl:variable name="pos" select="position()" />\r
-                 <replace search="{.}">\r
-                    <xsl:copy-of select="exsl:node-set($replace-nodes-rtf)/node()[$pos]" />\r
-                 </replace>\r
-              </xsl:for-each>\r
-           </xsl:variable>\r
-           <xsl:variable name="sorted-replacements-rtf">\r
-              <xsl:for-each select="exsl:node-set($replacements-rtf)/replace">\r
-                 <xsl:sort select="string-length(@search)" data-type="number" order="descending" />\r
-                 <xsl:copy-of select="." />\r
-              </xsl:for-each>\r
-           </xsl:variable>\r
-           <xsl:variable name="result">\r
-             <xsl:choose>\r
-                <xsl:when test="not($search)">\r
-                  <xsl:value-of select="$string" />\r
-                </xsl:when>\r
-               <xsl:otherwise>\r
-                 <xsl:call-template name="str:_replace">\r
-                    <xsl:with-param name="string" select="$string" />\r
-                    <xsl:with-param name="replacements" select="exsl:node-set($sorted-replacements-rtf)/replace" />\r
-                 </xsl:call-template>\r
-               </xsl:otherwise>\r
-             </xsl:choose>\r
-           </xsl:variable>\r
-           <func:result select="exsl:node-set($result)/node()" />\r
-        </xsl:when>\r
-        <xsl:otherwise>\r
-           <xsl:message terminate="yes">\r
-              ERROR: function implementation of str:replace() relies on exsl:node-set().\r
-           </xsl:message>\r
-        </xsl:otherwise>\r
-     </xsl:choose>\r
-  </func:function>\r
-\r
-  <xsl:template name="str:_replace">\r
-    <xsl:param name="string" select="''" />\r
-    <xsl:param name="replacements" select="/.." />\r
-    <xsl:choose>\r
-      <xsl:when test="not($string)" />\r
-      <xsl:when test="not($replacements)">\r
-        <xsl:value-of select="$string" />\r
-      </xsl:when>\r
-      <xsl:otherwise>\r
-        <xsl:variable name="replacement" select="$replacements[1]" />\r
-        <xsl:variable name="search" select="$replacement/@search" />\r
-        <xsl:choose>\r
-          <xsl:when test="not(string($search))">\r
-            <xsl:value-of select="substring($string, 1, 1)" />\r
-            <xsl:copy-of select="$replacement/node()" />\r
-            <xsl:call-template name="str:_replace">\r
-              <xsl:with-param name="string" select="substring($string, 2)" />\r
-              <xsl:with-param name="replacements" select="$replacements" />\r
-            </xsl:call-template>\r
-          </xsl:when>\r
-          <xsl:when test="contains($string, $search)">\r
-            <xsl:call-template name="str:_replace">\r
-              <xsl:with-param name="string" select="substring-before($string, $search)" />\r
-              <xsl:with-param name="replacements" select="$replacements[position() > 1]" />\r
-            </xsl:call-template>      \r
-            <xsl:copy-of select="$replacement/node()" />\r
-            <xsl:call-template name="str:_replace">\r
-              <xsl:with-param name="string" select="substring-after($string, $search)" />\r
-              <xsl:with-param name="replacements" select="$replacements" />\r
-            </xsl:call-template>\r
-          </xsl:when>\r
-          <xsl:otherwise>\r
-            <xsl:call-template name="str:_replace">\r
-              <xsl:with-param name="string" select="$string" />\r
-              <xsl:with-param name="replacements" select="$replacements[position() > 1]" />\r
-            </xsl:call-template>\r
-          </xsl:otherwise>\r
-        </xsl:choose>\r
-      </xsl:otherwise>\r
-    </xsl:choose>\r
-  </xsl:template>\r
-\r
-</xsl:stylesheet>
\ No newline at end of file