WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:TRL
Description:Text Recursion Language reads and processes resource requests within a text template
Id:TRLRuntime
Category:accessor
Identifier Syntax

TRL is an accessor using Active URI syntax with the following base identifiers:

Base
active:trl

and the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
template
Mandatory
Representation (java.lang.Object)Text template
mimetype
Optional
Representation (java.lang.Object)MIME type of response
tolerant
Optional
Representation (java.lang.Object)enable tolerance of errors (value of argument not important, just it's existence)
preserveComments
Optional
Representation (java.lang.Object)comment lines are not stripped, are processed as text and are preserved in the output
varargs [varargs] Any quantityRepresentation (java.lang.Object)Varargs allows an arbitrary number of additional unspecified arguments.
Request Verbs

The following verb is supported:

Verb
SOURCE
Response

The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use TRL accessor you must import the module urn:org:netkernel:lang:trl:

<import>
  <uri>urn:org:netkernel:lang:trl</uri>
</import>

SOURCE

When a request with the SOURCE verb is issued to active:trl the template specified in the required template argument is examined for any TRL resource requests, which are processed recursively.

template

A text resource containing TRL requests.

mimetype

When specified, overrides the default "text/plain" mimetype of the response.

tolerant

If a tolerant argument is specified then the TRL runtime will not fail if an error occurs processing any of the processing instructions contained in the template but rather will include the exception message as a {TRL-ERROR} block.

Include Declarations

TRL includes are specified with a ${...} marker - the value it contains may be either a simple resource identifier or may be a full declarative request.

For example...

Hello ${res:/some/path/to/world.txt}

or equally

 Hello ${
 	
		active:groovy
		res:/some/script
	
 } 

Simple identifiers must not include whitespace and must be valid fully escaped identifiers. Declarative requests may be multiline and contain arbitrary white space and may also include comment lines (see below).

HTML Escaping of included resource

Use $e{...} if you wish to ensure that the included resource is HTML escaped and so safe from XSS vectors.

Explicit Termination of Recursion

Use $t{...} if you wish to explicitly terminate recursion so that the included reference is not evaluated. This allows you to include resources that might themselves include ${...} patterns but which you want to use as literal values and do not want evaluated.

$te{....} is both terminated and HTML escaped.

Asynchronous requests

Use $a{...} if you wish requests to be issued asynchronously.

Comments

Any line starting with the # character will be treated as a comment and will be stripped from the response representation. Comment stripping will be disabled if the perserveComments argument is supplied.