TXTXSLT Statements


Table of Contents

Statement descriptions
apply
apply-imports
attribute
attribute-set
call
cdata
choose
comment
copy
copy-of
decimal
element
fallback
for-each
if
import
include
key
msg
msg-fatal
namespace
namespace-alias
number
otherwise
output
param
preserve
processing-instruction
sort
strip
stylesheet
tpl
tx
tx-no-esc
val
val-no-esc
var
when

Statement descriptions

apply

XML Element apply-templates

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name select Field name .select

  • Attribute name mode Field name .mode

An example of using apply

apply .select "statement"
  sort .by "txtName"

apply .select "requiredFields/field" .mode "required"

apply-imports

XML Element apply-imports

This statement has no required fields.

An example of using apply-imports

choose
  when "$ischunk = 1"
    call "process-chunk-element"
  otherwise
    apply-imports

attribute

XML Element attribute

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name namespace Field name namespace

An example of using attribute

<a>
  attribute "href"
    call "href.target" ("object":"$target[1]")

attribute-set

XML Element attribute-set

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name use-attribute-sets Field name .use-attribute-sets

call

XML Element call-template

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

An example of using call

call "href.target" ("object":"$target[1]")

call "gentext.template" ("context":"'msgset'", "name":"'MsgLevel'"

call "section.heading"
  param "level" .select "2"
  param "title"
    apply .select "." .mode "object.title.markup"

cdata

XML Element text

This statement has no required fields.

choose

XML Element choose

This statement has no required fields.

An example of using choose

choose
  when "count(requiredFields) > 1"
    <para>
      "There are some required fields"
  when "count(requiredFields) = 1"
    <para>
      "There is one required field"
  otherwise
    <para>
      "No required fields"

comment

XML Element comment

This statement has no required fields.

copy

XML Element copy

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name use-attribute-sets Field name .use-attribute-sets

copy-of

XML Element copy-of

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name select

An example of using copy-of

choose
  when "$localinfo != ''"
    var "node" .select "$outline//*[@id=$localinfo]"
    copy-of "$node/xref"
  otherwise
    val "$outline/xref"

decimal

XML Element decimal-format

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name name Field name .name

  • Attribute name decimal-separator Field name .decimal-sep

  • Attribute name grouping-separator Field name .group-sep

  • Attribute name infinity Field name .infinity

  • Attribute name minus-sign Field name .minus-sign

  • Attribute name NaN Field name .nan

  • Attribute name percent Field name .percent

  • Attribute name per-mille Field name .per-mille

  • Attribute name zero-digit Field name .zero-digit

  • Attribute name digit Field name .digit

  • Attribute name pattern-separator Field name .pattern-sep

element

XML Element element

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name namespace Field name namespace

  • Attribute name use-attribute-sets Field name .use-attribute-sets

fallback

XML Element fallback

This statement has no required fields.

for-each

XML Element for-each

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name select

if

XML Element if

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name test

import

XML Element import

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name href

include

XML Element include

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name href

key

XML Element key

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

  2. Attribute name match

  3. Attribute name use

msg

XML Element message

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name terminate Field name

msg-fatal

XML Element message

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name terminate Field name

namespace

XML Element This statement has no corresponding xml element.

This statement has no required fields.

namespace-alias

XML Element namespace-alias

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name stylesheet-prefix

  2. Attribute name result-prefix

number

XML Element number

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name level Field name .level

  • Attribute name count Field name .count

  • Attribute name from Field name .from

  • Attribute name value Field name val

  • Attribute name format Field name .format

  • Attribute name lang Field name .lang

  • Attribute name letter-value Field name .letter-value

  • Attribute name grouping-separator Field name .group-sep

  • Attribute name grouping-size Field name .group-size

otherwise

XML Element otherwise

This statement has no required fields.

An example of using otherwise

choose
  when "count(requiredFields) > 1"
    <para>
      "There are some required fields"
  when "count(requiredFields) = 1"
    <para>
      "There is one required field"
  otherwise
    <para>
      "No required fields"

output

XML Element output

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name method Field name .method

  • Attribute name version Field name .version

  • Attribute name encoding Field name .encoding

  • Attribute name omit-xml-declaration Field name .omit-xml-declaration

  • Attribute name standalone Field name .standalone

  • Attribute name doctype-public Field name .doctype-public

  • Attribute name doctype-system Field name .doctype-system

  • Attribute name cdata-section-elements Field name .cdata-section-elements

  • Attribute name indent Field name .indent

  • Attribute name media-type Field name .media-type

param

XML Element with-param

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name select Field name .select

An example of using param

call "columnTemplate" ("title"%"One", "value":"@cost")

call "columnTemplate"
  param "title"
    "One"
  param "value" .select "@cost"

preserve

XML Element preserve-space

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name elements

processing-instruction

XML Element processing-instruction

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

sort

XML Element sort

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name select Field name .by

  • Attribute name lang Field name .lang

  • Attribute name data-type Field name .data-type

  • Attribute name order Field name .order

  • Attribute name case-order Field name .case-order

strip

XML Element strip-space

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name elements

stylesheet

XML Element stylesheet

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name version

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name id Field name .id

  • Attribute name extension-element-prefixes Field name .extension-element-prefixes

  • Attribute name exclude-result-prefixes Field name .exclude-result-prefixes

tpl

XML Element template

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name name Field name .name

  • Attribute name match Field name .match

  • Attribute name mode Field name .mode

  • Attribute name priority Field name .priority

tx

XML Element text

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name disable-output-escaping Field name

tx-no-esc

XML Element text

This statement has no required fields.

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name disable-output-escaping Field name

val

XML Element value-of

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name select

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name disable-output-escaping Field name

val-no-esc

XML Element value-of

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name select

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name disable-output-escaping Field name

var

XML Element variable

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name name

This statement has the following optional fields. These can be provided in any order. Each shows the xml attribute name and the txt field name to use

  • Attribute name select Field name .select

when

XML Element when

This statement has some required fields. Their values must be provided in the order shown below. Each field corresponds to an xml attribute the name of which is shown.

  1. Attribute name test

An example of using when

choose
  when "count(requiredFields) > 1"
    <para>
      "There are some required fields"
  when "count(requiredFields) = 1"
    <para>
      "There is one required field"
  otherwise
    <para>
      "No required fields"