XMLEXTRACT()

Scalar. Extracts the portion of an XML value that matches a given XPATH expression.

Syntax

XMLEXTRACT( [value ,] xpath])
Parameters

value

The XML value. Can be omitted when used with XMLTABLE.

xpath

The XPATH expression.

Data Types

Return

value

xpath

XML

XML

String

Usage

Sybase CEP Engine evaluates the XPATH expression xpath against the specified value (or the implicit value in XMLTABLE) and returns the matching portion, if found. If xpath is a sequence, Sybase CEP Engine evaluates the sequence in order and concatenates the results. If value is Null, XMLEXTRACT returns Null. If a partial XPATH result is not an element tree or a sequence of element trees, XPATH generates a warning and ignores the partial result.

See Also

Example

The following example shows an extraction of all "orderid" element nodes:

INSERT INTO OutStream
SELECT XMLEXTRACT(OrderVal2,'//orderid')
FROM Orders;