Univer - XSLT 2 0 Cheat Sheet
Univer - XSLT 2 0 Cheat Sheet
XSL stands for EXtensible Stylesheet fallback Specifies an alternate code to run if otherwise Specifies a default action for the
Language, and is a style sheet language for the processor does not support an <choose> element
XML documents. XSLT element
output Defines the format of the output
XSLT stands for XSL Transformations. In this
for-each Loops through each node in a document
tutorial you will learn how to use XSLT to
specified node set
param Declares a local or global
transform XML documents into other formats,
if Contains a template that will be parameter
like XHTML.
applied only if a specified condition
preserve-s Defines the elements for which
is true
Elements pace white space should be preserved
import Imports the contents of one style processing Writes a processing instruction to
apply-im Applies a template rule from an sheet into another. Note: An
- the output
ports imported style sheet imported style sheet has lower
instruction
apply-te Applies a template rule to the precedence than the importing
sort Sorts the output
mplates current element or to the current style sheet
element's child nodes strip-space Defines the elements for which
include Includes the contents of one style
white space should be removed
attribute Adds an attribute sheet into another. Note: An
included style sheet has the same stylesheet Defines the root element of a
attribute- Defines a named set of attributes
precedence as the including style style sheet
set
sheet template Rules to apply when a specified
call- Calls a named template
key Declares a named key that can be node is matched
template
used in the style sheet with the text Writes literal text to the output
choose Used in conjunction with <when>
key() function
and <otherwise> to express transform Defines the root element of a
message Writes a message to the output style sheet
multiple conditional tests
(used to report errors)
comment Creates a comment node in the value-of Extracts the value of a selected
namespa Replaces a namespace in the style node
result tree
ce-alias sheet to a different namespace in
copy Creates a copy of the current node variable Declares a local or global variable
the output
(without child nodes and when Specifies an action for the
number Determines the integer position of
attributes) <choose> element
the current node and formats a
copy-of Creates a copy of the current node number with- Defines the value of a parameter
(with child nodes and attributes) param to be passed into a template
decimal- Defines the characters and symbols
format to be used when converting
numbers into strings, with the
format-number() function
Selects all nodes with the name Returns the node-name of the argument ) argument. The argument could
be a boolean, string, or node-set
"nodename" node
abs(num) Returns the absolute value of the
/ nilled(node)
argument
Selects from the root node Returns a Boolean value indicating whether
ceiling(num Returns the smallest integer that
the argument node is nilled
// ) is greater than the number
data(item.item,...) argument
Selects nodes in the whole document
Takes a sequence of items and returns a floor(num) Returns the largest integer that
.
sequence of atomic values is not greater than the number
Selects the current node argument
base-uri() fn:base-uri(node)
.. round(num) Rounds the number argument to
Returns the value of the base-uri property of
Selects the parent of the current node the nearest integer
the current or specified node
@ document-uri(node) Aggregate Functions
Selects attributes Returns the value of the document-uri
count((item,item,...))
* property for the specified node
Returns the count of nodes
Matches any element node
Functions on Nodes avg((arg,arg,...))
@*
name() Returns the node-name of the Returns the average of the argument values
Matches any attribute node
argument node max((arg,arg,...))
//node[1]
local-nam Returns a Boolean value Returns the argument that is greater than
Selects the first element that is the child of e() indicating whether the argument the others
the element. node is nilled
min((arg,arg,...))
//node[@class and @id] namespac Takes a sequence of items and
e-uri() returns a sequence of atomic Returns the argument that is less than the
select the node with both "class" and "id"
values others
//node[count(child)=2]
lang(lang) Returns the value of the base-uri sum(arg,arg,...)
select the node with two "child" elements property of the current or specified Returns the sum of the numeric value of
node each node in the specified node-set
//node[contains(@title,"text")]
select the node with "text" in the title attribute root() Returns the value of the
document-uri property for the Context Functions
//node[child/child1] specified node
position() Returns the index position of the
select the node with "child/child1" child
node that is currently being
nodes
processed
//node[position() mode 2 ==0]
//node/text()[2]
//node[not(@class)]