\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Jin Lei (Univer)} \pdfinfo{ /Title (xslt-2-0-cheat-sheet.pdf) /Creator (Cheatography) /Author (Jin Lei (Univer)) /Subject (XSLT 2.0 Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{4F81BD} \definecolor{LightBackground}{HTML}{F4F7FA} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{XSLT 2.0 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Jin Lei (Univer)} via \textcolor{DarkBackground}{\uline{cheatography.com/2588/cs/673/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Jin Lei (Univer) \\ \uline{cheatography.com/univer} \\ \uline{\seqsplit{jinlei}.me} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 21st November, 2012.\\ Updated 12th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{About}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. \newline % Row Count 2 (+ 2) XSLT stands for XSL Transformations. In this tutorial you will learn how to use XSLT to transform XML documents into other formats, like XHTML.% Row Count 5 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Elements}} \tn % Row 0 \SetRowColor{LightBackground} apply-imports & Applies a template rule from an imported style sheet \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{apply-templates} & Applies a template rule to the current element or to the current element's child nodes \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} attribute & Adds an attribute \tn % Row Count 7 (+ 1) % Row 3 \SetRowColor{white} attribute-set & Defines a named set of attributes \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} call-template & Calls a named template \tn % Row Count 10 (+ 1) % Row 5 \SetRowColor{white} choose & Used in conjunction with \textless{}when\textgreater{} and \textless{}otherwise\textgreater{} to express multiple conditional tests \tn % Row Count 14 (+ 4) % Row 6 \SetRowColor{LightBackground} comment & Creates a comment node in the result tree \tn % Row Count 16 (+ 2) % Row 7 \SetRowColor{white} copy & Creates a copy of the current node (without child nodes and attributes) \tn % Row Count 19 (+ 3) % Row 8 \SetRowColor{LightBackground} copy-of & Creates a copy of the current node (with child nodes and attributes) \tn % Row Count 22 (+ 3) % Row 9 \SetRowColor{white} \seqsplit{decimal-format} & Defines the characters and symbols to be used when converting numbers into strings, with the format-number() function \tn % Row Count 27 (+ 5) % Row 10 \SetRowColor{LightBackground} element & Creates an element node in the output document \tn % Row Count 29 (+ 2) % Row 11 \SetRowColor{white} fallback & Specifies an alternate code to run if the processor does not support an XSLT element \tn % Row Count 33 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Elements (cont)}} \tn % Row 12 \SetRowColor{LightBackground} for-each & Loops through each node in a specified node set \tn % Row Count 2 (+ 2) % Row 13 \SetRowColor{white} if & Contains a template that will be applied only if a specified condition is true \tn % Row Count 5 (+ 3) % Row 14 \SetRowColor{LightBackground} import & Imports the contents of one style sheet into another. Note: An imported style sheet has lower precedence than the importing style sheet \tn % Row Count 11 (+ 6) % Row 15 \SetRowColor{white} include & Includes the contents of one style sheet into another. Note: An included style sheet has the same precedence as the including style sheet \tn % Row Count 17 (+ 6) % Row 16 \SetRowColor{LightBackground} key & Declares a named key that can be used in the style sheet with the key() function \tn % Row Count 21 (+ 4) % Row 17 \SetRowColor{white} message & Writes a message to the output (used to report errors) \tn % Row Count 24 (+ 3) % Row 18 \SetRowColor{LightBackground} \seqsplit{namespace-alias} & Replaces a namespace in the style sheet to a different namespace in the output \tn % Row Count 27 (+ 3) % Row 19 \SetRowColor{white} number & Determines the integer position of the current node and formats a number \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Elements (cont)}} \tn % Row 20 \SetRowColor{LightBackground} otherwise & Specifies a default action for the \textless{}choose\textgreater{} element \tn % Row Count 2 (+ 2) % Row 21 \SetRowColor{white} output & Defines the format of the output document \tn % Row Count 4 (+ 2) % Row 22 \SetRowColor{LightBackground} param & Declares a local or global parameter \tn % Row Count 6 (+ 2) % Row 23 \SetRowColor{white} \seqsplit{preserve-space} & Defines the elements for which white space should be preserved \tn % Row Count 9 (+ 3) % Row 24 \SetRowColor{LightBackground} \seqsplit{processing-instruction} & Writes a processing instruction to the output \tn % Row Count 11 (+ 2) % Row 25 \SetRowColor{white} sort & Sorts the output \tn % Row Count 12 (+ 1) % Row 26 \SetRowColor{LightBackground} strip-space & Defines the elements for which white space should be removed \tn % Row Count 15 (+ 3) % Row 27 \SetRowColor{white} stylesheet & Defines the root element of a style sheet \tn % Row Count 17 (+ 2) % Row 28 \SetRowColor{LightBackground} template & Rules to apply when a specified node is matched \tn % Row Count 19 (+ 2) % Row 29 \SetRowColor{white} text & Writes literal text to the output \tn % Row Count 21 (+ 2) % Row 30 \SetRowColor{LightBackground} transform & Defines the root element of a style sheet \tn % Row Count 23 (+ 2) % Row 31 \SetRowColor{white} value-of & Extracts the value of a selected node \tn % Row Count 25 (+ 2) % Row 32 \SetRowColor{LightBackground} variable & Declares a local or global variable \tn % Row Count 27 (+ 2) % Row 33 \SetRowColor{white} when & Specifies an action for the \textless{}choose\textgreater{} element \tn % Row Count 29 (+ 2) % Row 34 \SetRowColor{LightBackground} with-param & Defines the value of a parameter to be passed into a template \tn % Row Count 32 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Selectors}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{nodename} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects all nodes with the name "nodename"} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{/} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects from the root node} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{//} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects nodes in the whole document} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{.} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects the current node} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{..} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects the parent of the current node} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{@} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects attributes} \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{*} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Matches any element node} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{@*} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Matches any attribute node} \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{//node{[}1{]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects the first element that is the child of the element.} \tn % Row Count 19 (+ 3) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{//node{[}@class and @id{]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}select the node with both "class" and "id"} \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{//node{[}count(child)=2{]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}select the node with two "child" elements} \tn % Row Count 23 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{//node{[}contains(@title,"text"){]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}select the node with "text" in the title attribute} \tn % Row Count 26 (+ 3) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{//node{[}child/child1{]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}select the node with "child/child1" child nodes} \tn % Row Count 28 (+ 2) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{//node{[}position() mode 2 ==0{]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}select the odd children elements} \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Selectors (cont)}} \tn % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{//node/text(){[}2{]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}return the second text element of node} \tn % Row Count 2 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{//node{[}not(@class){]}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}the node without "class" attribute} \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Accessor Functions}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{node-name(node)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the node-name of the argument node} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{nilled(node)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns a Boolean value indicating whether the argument node is nilled} \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{data(item.item,...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Takes a sequence of items and returns a sequence of atomic values} \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{base-uri() fn:base-uri(node)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the value of the base-uri property of the current or specified node} \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{document-uri(node)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the value of the document-uri property for the specified node} \tn % Row Count 14 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Functions on Nodes}} \tn % Row 0 \SetRowColor{LightBackground} name() & Returns the node-name of the argument node \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{local-name()} & Returns a Boolean value indicating whether the argument node is nilled \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \seqsplit{namespace-uri()} & Takes a sequence of items and returns a sequence of atomic values \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \seqsplit{lang(lang)} & Returns the value of the base-uri property of the current or specified node \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} root() & Returns the value of the document-uri property for the specified node \tn % Row Count 14 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.14471 cm} x{3.83229 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Functions on Numeric Values}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{number(arg)} & Returns the numeric value of the argument. The argument could be a boolean, string, or node-set \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} abs(num) & Returns the absolute value of the argument \tn % Row Count 6 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{ceiling(num)} & Returns the smallest integer that is greater than the number argument \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} \seqsplit{floor(num)} & Returns the largest integer that is not greater than the number argument \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} \seqsplit{round(num)} & Rounds the number argument to the nearest integer \tn % Row Count 14 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Aggregate Functions}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{count((item,item,...))} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the count of nodes} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{avg((arg,arg,...))} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the average of the argument values} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{max((arg,arg,...))} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the argument that is greater than the others} \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{min((arg,arg,...))} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the argument that is less than the others} \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{sum(arg,arg,...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the sum of the numeric value of each node in the specified node-set} \tn % Row Count 13 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.54287 cm} x{3.43413 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Context Functions}} \tn % Row 0 \SetRowColor{LightBackground} position() & Returns the index position of the node that is currently being processed \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} last() & Returns the number of items in the processed node list \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{current-dateTime()} & Returns the current dateTime (with timezone) \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{current-date()} & Returns the current date (with timezone) \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{current-time()} & Returns the current time (with timezone) \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Functions on Strings}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{string(arg)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the string value of the argument. The argument could be a number, boolean, or node-set} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{codepoints-to-string(int,int,...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns a string from a sequence of code points} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{string-to-codepoints(string)}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns a sequence of code points from a string} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{codepoint-equal(comp1,comp2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns true if the value of comp1 is equal to the value of comp2, according to the Unicode code point collation, otherwise it returns false} \tn % Row Count 11 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{compare(comp1,comp2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)} \tn % Row Count 16 (+ 5) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{string-join((string,string,...),sep)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns a string created by concatenating the string arguments and using the sep argument as the separator} \tn % Row Count 20 (+ 4) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{substring(string,start,len)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the substring from the start position to the specified length. Index of the first character is 1. If length is omitted it returns the substring from the start position to the end} \tn % Row Count 25 (+ 5) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{string-length(string)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the length of the specified string. If there is no string argument it returns the length of the string value of the current node} \tn % Row Count 29 (+ 4) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{normalize-space(string)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Removes leading and trailing spaces from the specified string, and replaces all internal sequences of white space with one and returns the result. If there is no string argument it does the same on the current node} \tn % Row Count 35 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Functions on Strings (cont)}} \tn % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{normalize-unicode()} \tn % Row Count 1 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{upper-case(string)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Converts the string argument to upper-case} \tn % Row Count 3 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{lower-case(string)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Converts the string argument to lower-case} \tn % Row Count 5 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{translate(string1,string2,string3)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Converts string1 by replacing the characters in string2 with the characters in string3} \tn % Row Count 8 (+ 3) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{escape-uri(stringURI,esc-res)} \tn % Row Count 9 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{contains(string1,string2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns true if string1 contains string2, otherwise it returns false} \tn % Row Count 12 (+ 3) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{starts-with(string1,string2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns true if string1 starts with string2, otherwise it returns false} \tn % Row Count 15 (+ 3) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{ends-with(string1,string2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns true if string1 ends with string2, otherwise it returns false} \tn % Row Count 18 (+ 3) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{substring-before(str1,str2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the start of string1 before string2 occurs in it} \tn % Row Count 21 (+ 3) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{substring-after(str1,str2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns the remainder of string1 after string2 occurs in it} \tn % Row Count 24 (+ 3) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{matches(string,pattern)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns true if the string argument matches the pattern, otherwise, it returns false} \tn % Row Count 27 (+ 3) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{replace(string,pattern,replace)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns a string that is created by replacing the given pattern with the replace argument} \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Functions on Strings (cont)}} \tn % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{tokenize(string,pattern)} \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.14471 cm} x{3.83229 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Functions on Boolean Values}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{boolean(arg)} & Returns a boolean value for a number, string, or node-set \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} not(arg) & The argument is first reduced to a boolean value by applying the boolean() function. Returns true if the boolean value is false, and false if the boolean value is true \tn % Row Count 8 (+ 6) % Row 2 \SetRowColor{LightBackground} true() & Returns the boolean value true \tn % Row Count 9 (+ 1) % Row 3 \SetRowColor{white} false() & Returns the boolean value false \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}