string.xsl revision febf3f1de573e25fb134b8453a22b0732b4c52e2
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync<!-- This file is taken from the XSLT Standard Library as available
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync from http://xsltsl.sourceforge.net/. Except for this notice, it
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync has not been modified. -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync xmlns:doc="http://xsltsl.org/xsl/documentation/1.0"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <referenceinfo>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync $Id: string.xsl,v 1.13 2004/10/08 06:37:25 balls Exp $
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </releaseinfo>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <copyright>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </copyright>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </referenceinfo>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <partintro>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>This module provides templates for manipulating strings.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </partintro>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- Common string constants and datasets as XSL variables -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- str:lower and str:upper contain pairs of lower and upper case
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync characters. Below insanely long strings should contain the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync official lower/uppercase pairs, making this stylesheet working
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync for every language on earth. Hopefully. -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- These values are not enough, however. There are some
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync exceptions, dealt with below. -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="xsltsl-str-lower" select="'abcdefghijklmnopqrstuvwxyzµàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĺļľŀłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżžſƃƅƈƌƒƕƙơƣƥƨƭưƴƶƹƽƿDždžLjljNjnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯDzdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȣȥȧȩȫȭȯȱȳɓɔɖɗəɛɠɣɨɩɯɲɵʀʃʈʊʋʒͅάέήίαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϐϑϕϖϛϝϟϡϣϥϧϩϫϭϯϰϱϲϵабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӈӌӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹաբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕẛạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹἀἁἂἃἄἅἆἇἐἑἒἓἔἕἠἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷὀὁὂὃὄὅὑὓὕὗὠὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώᾀᾁᾂᾃᾄᾅᾆᾇᾐᾑᾒᾓᾔᾕᾖᾗᾠᾡᾢᾣᾤᾥᾦᾧᾰᾱᾳιῃῐῑῠῡῥῳⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩabcdefghijklmnopqrstuvwxyz𐐨𐐩𐐪𐐫𐐬𐐭𐐮𐐯𐐰𐐱𐐲𐐳𐐴𐐵𐐶𐐷𐐸𐐹𐐺𐐻𐐼𐐽𐐾𐐿𐑀𐑁𐑂𐑃𐑄𐑅𐑆𐑇𐑈𐑉𐑊𐑋𐑌𐑍'"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="xsltsl-str-upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZΜÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮIIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŹŻŽSƂƄƇƋƑǶƘƠƢƤƧƬƯƳƵƸƼǷDŽDŽLJLJNJNJǍǏǑǓǕǗǙǛƎǞǠǢǤǦǨǪǬǮDZDZǴǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȢȤȦȨȪȬȮȰȲƁƆƉƊƏƐƓƔƗƖƜƝƟƦƩƮƱƲƷΙΆΈΉΊΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΣΤΥΦΧΨΩΪΫΌΎΏΒΘΦΠϚϜϞϠϢϤϦϨϪϬϮΚΡΣΕАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӁӃӇӋӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔṠẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸἈἉἊἋἌἍἎἏἘἙἚἛἜἝἨἩἪἫἬἭἮἯἸἹἺἻἼἽἾἿὈὉὊὋὌὍὙὛὝὟὨὩὪὫὬὭὮὯᾺΆῈΈῊΉῚΊῸΌῪΎῺΏᾈᾉᾊᾋᾌᾍᾎᾏᾘᾙᾚᾛᾜᾝᾞᾟᾨᾩᾪᾫᾬᾭᾮᾯᾸᾹᾼΙῌῘῙῨῩῬῼⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏABCDEFGHIJKLMNOPQRSTUVWXYZ𐐀𐐁𐐂𐐃𐐄𐐅𐐆𐐇𐐈𐐉𐐊𐐋𐐌𐐍𐐎𐐏𐐐𐐑𐐒𐐓𐐔𐐕𐐖𐐗𐐘𐐙𐐚𐐛𐐜𐐝𐐞𐐟𐐠𐐡𐐢𐐣𐐤𐐥'"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="xsltsl-str-digits" select="'0123456789'"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- space (#x20) characters, carriage returns, line feeds, or tabs. -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="xsltsl-str-ws" select="' 	
'"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Converts all lowercase letters to uppercase.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Returns string with all uppercase letters.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- Below exception is extracted from unicode's SpecialCasing.txt
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync file. It's the german lowercase "eszett" (the thing looking
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync like a greek beta) that's to become "SS" in uppercase (note:
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync that are *two* characters, that's why it doesn't fit in the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync list of upper/lowercase characters). There are more
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync characters in that file (103, excluding the locale-specific
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync ones), but they seemed to be much less used to me and they
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync add up to a hellish long stylesheet.... - Reinout -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="translate($modified-text, $xsltsl-str-lower, $xsltsl-str-upper)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Converts all uppercase letters to lowercase.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Returns string with all lowercase letters.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="translate($text, $xsltsl-str-upper, $xsltsl-str-lower)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Converts first character of string to an uppercase letter. All remaining characters are converted to lowercase.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Boolean controlling whether all words in the string are capitalised.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Returns string with first character uppcase and all remaining characters lowercase.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="$all and (contains($text, ' ') or contains($text, ' ') or contains($text, ' '))">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name="str:substring-before-first">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="chars" select="$xsltsl-str-ws"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="substring($text, string-length($firstword) + 1, 1)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="substring($text, string-length($firstword) + 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring($text, 1, 1)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring($text, 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refpurpose>Convert a string to one camelcase word</refpurpose>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Converts a string to one lowerCamelCase or UpperCamelCase
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync word, depending on the setting of the "upper"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync parameter. UpperCamelCase is also called MixedCase while
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync lowerCamelCase is also called just camelCase. The template
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync removes any spaces, tabs and slashes, but doesn't deal with
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync other punctuation. It's purpose is to convert strings like
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "hollow timber flush door" to a term suitable as identifier or
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync XML tag like "HollowTimberFlushDoor".
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Boolean controlling whether the string becomes an
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync UpperCamelCase word or a lowerCamelCase word.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Returns string with first character uppcase and all remaining characters lowercase.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- First change all 'strange' characters to spaces -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="translate($text,concat($xsltsl-str-ws,'/'),' ')"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- Then process them -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name="str:substring-before-first">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="$string-with-only-spaces"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="chars" select="$xsltsl-str-ws"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring($firstword, 1, 1)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring($firstword, 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="substring($string-with-only-spaces, string-length($firstword) + 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="translate($before-space-removal,' ','')"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <doc:template name="str:substring-before-first" xmlns="">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Extracts the portion of string 'text' which occurs before any of the characters in string 'chars'.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string from which to extract a substring.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string containing characters to find.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="contains($text, substring($chars, 1, 1))">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="this" select="substring-before($text, substring($chars, 1, 1))"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name="str:substring-before-first">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="chars" select="substring($chars, 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="string-length($this) < string-length($rest)">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name="str:substring-before-first">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="chars" select="substring($chars, 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <doc:template name="str:substring-after-last" xmlns="">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Extracts the portion of string 'text' which occurs after the last of the character in string 'chars'.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string from which to extract a substring.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string containing characters to find.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="last" select="substring-after($text, $chars)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name="str:substring-after-last">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <doc:template name="str:substring-before-last" xmlns="">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Extracts the portion of string 'text' which occurs before the first character of the last occurance of string 'chars'.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string from which to extract a substring.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string containing characters to find.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name="str:substring-before-last-aux">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:template name="str:substring-before-last-aux">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name="str:substring-before-last-aux">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring-after($text, $chars)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="substring-before($text, $chars)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Substitute 'replace' for 'with' in string 'text'.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string upon which to perform substitution.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>A value of <literal>yes</literal> indicates that the result should have output escaping disabled. Any other value allows normal escaping of text values. The default is to enable output escaping.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:param name='disable-output-escaping'>no</xsl:param>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="string-length($replace) = 0 and $disable-output-escaping = 'yes'">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="$text" disable-output-escaping='yes'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="before" select="substring-before($text, $replace)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="after" select="substring-after($text, $replace)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="$before" disable-output-escaping="yes"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="$with" disable-output-escaping="yes"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="disable-output-escaping" select="$disable-output-escaping"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="$text" disable-output-escaping="yes"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Counts the number of times a substring occurs in a string. This can also counts the number of times a character occurs in a string, since a character is simply a string of length 1.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync<xsl:call-template name="str:count-substring">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="$mytext"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="chars" select="'
'"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync</xsl:call-template>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="string-length($text) = 0 or string-length($chars) = 0">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring-after($text, $chars)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <doc:template name="str:substring-after-at" xmlns="">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Extracts the portion of a 'char' delimited 'text' string "array" at a given 'position'.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string from which to extract a substring.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>If true all of the remaining string is returned, otherwise only the element at the given position is returned. Default: false().</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test='number($position) = 0 and not($chars)'>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test='number($position) = 0 and not(contains($text, $chars))'>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="substring-before($text, $chars)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring-after($text, $chars)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="position" select="$position - 1"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <doc:template name="str:substring-before-at" xmlns="">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Extracts the portion of a 'char' delimited 'text' string "array" at a given 'position' </para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string from which to extract a substring.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select='substring-before($text, $chars)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="substring-after($text, $chars)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="position" select="$position - 1"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Insert 'chars' into "text' at any given "position'</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The string upon which to perform insertion</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>the position where insertion will be performed</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="firstpart" select="substring($text, 0, $position)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="secondpart" select="substring($text, $position, string-length($text))"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="concat($firstpart, $chars, $secondpart)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="position" select="string-length($text)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select="substring($mirror, string-length($text) + 1, string-length($text))"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="concat($text, substring($text, $position, 1))"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="position" select="$position - 1"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Inserts newlines and spaces into a string to format it as a block of text.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Number of spaces to insert at the beginning of each line.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Justify left, right or both. Not currently implemented (fixed at "left").</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test='string-length($text) = 0 or $max <= 0'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test='string-length($text) > $max and contains($text, " ") and string-length(substring-before($text, " ")) > $max'>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:value-of select='substring-before($text, " ")'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='text' select='substring-after($text, " ")'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test='string-length($text) > $max and contains($text, " ")'>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name='str:substring-before-last'>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='text' select='substring($text, 1, $max)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='text' select='substring($text, string-length($first) + 2)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refpurpose>Find first occurring character in a string</refpurpose>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Finds which of the given characters occurs first in a string.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="string-length($text) = 0 or string-length($chars) = 0"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="contains($text, substring($chars, 1, 1))">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="chars" select="substring($chars, 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="first-character-position" select="string-length(substring-before($text, substring($chars, 1, 1)))"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name="next-character-position" select="string-length(substring-before($text, $next-character))"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="$first-character-position < $next-character-position">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="chars" select="substring($chars, 2)"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refpurpose>Match A String To A Pattern</refpurpose>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Performs globbing-style pattern matching on a string.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync<xsl:call-template name="str:string-match">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="text" select="$mytext"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name="pattern" select="'abc*def?g'"/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync</xsl:call-template>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The pattern to match against. Certain characters have special meaning:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Character escape. The next character is taken as a literal character.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Returns "1" if the string matches the pattern, "0" otherwise.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refreturn>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- Special case: always matches -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="string-length($text) = 0 and string-length($pattern) = 0">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="string-length($text) = 0 or string-length($pattern) = 0">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:call-template name='str:substring-before-first'>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name='new-text' select='substring($text, string-length($before-special) + 1)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:variable name='new-pattern' select='substring($pattern, string-length($before-special) + 1)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="not(starts-with($text, $before-special))">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- Verbatim characters don't match -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="$special = '*' and string-length($new-pattern) = 1">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='pattern' select='substring($new-pattern, 2)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='text' select='substring($new-text, 2)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='pattern' select='substring($new-pattern, 2)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="$special = '\' and substring($new-text, 1, 1) = substring($new-pattern, 2, 1)">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='text' select='substring($new-text, 2)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='pattern' select='substring($new-pattern, 3)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="$special = '\' and substring($new-text, 1, 1) != substring($new-pattern, 2, 1)">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <!-- There were no special characters in the pattern -->
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:with-param name='text' select='substring($text, 2)'/>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refpurpose>Create A Repeating Sequence of Characters</refpurpose>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Repeats a string a given number of times.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refdescription>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The number of times to repeat the string.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </varlistentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </variablelist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </refparameter>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xsl:when test="string-length($text) = 0 or $count <= 0"/>