# Extension Module - Ft.Xml.Xslt.BuiltInExtFunctions

    4XSLT specific extension functions (i.e. ones that create a node set)

    Copyright 2005 Fourthought, Inc. (USA).
    Detailed license and copyright information: http://4suite.org/COPYRIGHT
    Project home, documentation, distributions: http://4suite.org/

## Namespaces

The namespace for extensions defined in this document are:

Prefix | Namespace
--- | ---
`f` | `http://xmlns.4suite.org/ext`

The prefix is given for this document only. Any other prefix can be used within a particular stylesheet.

## Functions

Function | Syntax
--- | ---
f:doc-as-string | unknown f:doc-as-string(obj, encoding)
f:key | unknown f:key(qname, keyList, realContextNode)
f:lookup | unknown f:lookup(name, key)
f:map | unknown f:map(funcname)
f:search-re | unknown f:search-re(pattern, arg)
f:serialize-xml | unknown f:serialize-xml(nodeset, method, omitxmldecl)
f:split | unknown f:split(arg, delim)

## Functions

### Function - f:doc-as-string

#### Function Syntax

unknown f:doc-as-string(obj, encoding)

Retrieves a document, similar to the document() function, but returns the document as an XPath string object rather than as a node-set. Security note: if the associated URI resolver allows file: URLs, this extension could be used to read arbitrary system files

### Function - f:key

#### Function Syntax

unknown f:key(qname, keyList, realContextNode)

Query an XSLT key, but allow the user to override the context node for purposes of determining which source document to check. realContextNode is a node set from which the first node is extracted And used as the context node

### Function - f:lookup

#### Function Syntax

unknown f:lookup(name, key)

f:lookup() queries an index as defined by f:create-index.

### Function - f:map

#### Function Syntax

unknown f:map(funcname)

Apply the function serially over the given node sets. In iteration i, the function is passed N parameters where N is the number of argument node sets. Each parameter is a node set of size 1, whose node is the ith node of the corresponding argument node set. The return value is a node set consisting of a series of result-tree nodes, each of which is a text node whose value is the string value of the result of the ith function invocation. Warning: this function uses the implied ordering of the node set Based on its implementation as a Python list. But in reality There is no reliable ordering of XPath node sets. Therefore this function is not recommended for use with more than one node set parameter.

### Function - f:search-re

#### Function Syntax

unknown f:search-re(pattern, arg)

Do a regular expression search against the argument (i.e. get all matches)

### Function - f:serialize-xml

#### Function Syntax

unknown f:serialize-xml(nodeset, method, omitxmldecl)

f:serialize-xml() takes a node set and turns it into a string representing the serialization of the node set, obtained by concatenating the serialization of each node in the node set in document order. See also: XPath (not XSLT) extension function f:parse-xml()

### Function - f:split

#### Function Syntax

unknown f:split(arg, delim)

DEPRECATED. Equivalent to EXSLT's str:split(). Splits a string according to a sub-string and return a node set of elements nodes, each of which is named "Split" and contains the split text For example f:split('A,B,C,') returns a node set of "Split" nodes having text nodes with values "A", "B" and "C" arg - converted to a string, is the string to split up delim - the delimiter upon which to split, defaults to " "