Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions content/en/docs/user-guide/pipelines/xslt/xslt-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,16 @@ The following functions are available to aid your translation:
* [`lookup(String map, String key, String time)`](#lookup) - Look up a reference data map using a specified time, e.g. the event time
* [`lookup(String map, String key, String time, Boolean ignoreWarnings)`](#lookup) - Look up a reference data map using a specified time, e.g. the event time, and ignore any warnings generated by a failed lookup
* [`lookup(String map, String key, String time, Boolean ignoreWarnings, Boolean trace)`](#lookup) - Look up a reference data map using a specified time, e.g. the event time, ignore any warnings generated by a failed lookup and get trace information for the path taken to resolve the lookup.
* `manifest` - Returns an XML structure with the `stroom-meta` namespace detailing the manifest meta of the current stream being processed
* `manifest-for-id(String streamId)` - Returns an XML structure with the `stroom-meta` namespace detailing the manifest meta of the specified stream
* `meta(String key)` - Lookup a meta data value for the current stream using the specified key.
The key can be `Feed`, `StreamType`, `CreatedTime`, `EffectiveTime`, `Pipeline` or any other attribute supplied when the stream was sent to Stroom, e.g. meta('System').
* [`meta-keys()`](#meta-keys) - Returns an array of meta keys for the current stream. Each key can then be used to retrieve its corresponding meta value, by calling `meta($key)`.
* `meta-stream()` - Returns an XML structure with the `stroom-meta` namespace detailing the meta data of the current stream being processed
* `meta-stream-for-id(String streamId, Integer partNo)` - Returns an XML structure with the `stroom-meta` namespace detailing the meta data of the specified stream and part number (1 based)
* `numeric-ip(String ipAddress)` - Convert an IP address to a numeric representation for range comparison
* `parent-for-id(String streamId)` - Get the parent id of the specified input stream
* `parent-id()` - Get the parent id of the current input stream this is being processed
* `part-no()` - The current part within a multi part aggregated input stream (AKA the substream number) (1 based)
* [`parse-dateTime(String dateTime)`](#parse-dateTime) - Returns the dateTime of a specified ISO 8601 formatted string
* [`parse-dateTime(String dateTime, String pattern)`](#parse-dateTime) - Returns the dateTime for a specified string using the pattern
Expand Down Expand Up @@ -516,10 +522,12 @@ The reference date is the first of these values that is non-null

For example for a call of `stroom:format-date('28 Oct', 'dd MMM')` and a stream create time of `2024`, it will return `2024-10-28T00:00:00.000Z`.


## format-dateTime()

Formats the dateTime as a string according to the specified pattern and time zone.


### Function Signatures

The following are the possible forms of the `format-dateTime` function.
Expand All @@ -540,8 +548,8 @@ format-dateTime(DateTime dateTime, String pattern, String timeZone)
* `timeZone` - Optional time zone of the output.
If `null` then the UTC/Zulu time zone will be used.

### Examples

### Examples

```xml
<!-- Default format -->
Expand Down Expand Up @@ -627,27 +635,29 @@ stroom:format-dateTime('xs:dateTime("2009-02-02T04:34:11Z")', 'yyyy/MM/dd HH:mm:
-> '2009/02/01 23:34:11'
```


## hex-to-string()

For a hexadecimal input string, decode it using the specified character set to its original form.

Valid character set names are listed at: https://www.iana.org/assignments/character-sets/character-sets.xhtml.
Common examples are: `ASCII`, `UTF-8` and `UTF-16`.

### Example

#### Input

```xml
<string><xsl:value-of select="hex-to-string('74 65 73 74 69 6e 67 20 31 32 33', 'UTF-8')" /></string>
```


#### Output

```xml
<string>testing 123</string>
```


## http-call()

Executes an HTTP(S) request to a remote server and returns the response.
Expand Down Expand Up @@ -711,6 +721,7 @@ If you are using two-way SSL then you may need to set the protocol to `HTTP/1.1`
],
```


### Example output

The following is an example of the XML returned from the `http-call` function:
Expand Down