Home > WebEOC > Admin Guide > HTML Conventions > XSLT Tags

XSLT Tags

The WebEOC-specific XSLT tags can be used on your boards for various different purposes and functions. Before using any of these tags, you may wish to review the allowed values and requirements so as to better understand the tags listed and how to properly implement them on your boards.

Tags

<attribute>

Mechanism to add attributes to tags while maintaining valid XML. <attribute> can contain other tags, such as <if>, for conditional processing.

Attribute

Allowed Values

Requirements

Description

name

%attributename

Required

Name of the attribute to add to the parent node.

Example

<a>
<attribute name="href">
<expression name="href">url</expression>
</attribute>
A link
</a>

<choose>

Mechanism for conditional processing. Like the <if> tag but provides the <otherwise> tag that renders whenever none of the <when> tags evaluate as true. The test attribute is the Boolean test to evaluate. For example:

<choose>
<when test="@status='Open'">Open</when>
<when test="@status='Closed'">Closed</when>
<otherwise>Full</otherwise>
</choose>

<element>

Creates an element node.

Attribute

Allowed Values

Requirements

Description

name

%filename

Required

Name of the element, of which becomes an HTML tag in the generated HTML document.

<for-each>

Iterates over a collection of XML elements.

Attribute

Allowed Values

Requirements

Description

select

%filename

Required

Name fo the field, prefixed with @.

<if>

Mechanism for conditional processing. Use the <if> tag to evaluate Boolean expressions and alter the presentation based on the result. If the test is true, the contents of the tag are displayed. If false, the contents are omitted.

The <if> tag maps directly to an XSL. Set the test attribute to conduct the test you want to perform. The contents should be the output that results if the test is true. Use @ in front of field names. Any WebEOC field referenced in the <if> statement must have a corresponding <eocfield> tag somewhere in the view.

Attribute

Allowed Values

Requirements

Description

test

CDATA

Required

XSL conditional statement; field names are prefixed with @ and must exist as <eocfield> tags in the view.

Tips

  • Preface field names with the @ symbol.

  • Enclose string literals in single quotes (apostrophes).

  • Any WebEOC field referenced in the <if> statement must have a corresponding <eocfield> tag somewhere on the view.

Examples

<td>
<attribute name="bgcolor">
<if test="@overdue='true'">red</if>
<if test="@overdue='false'">green</if>
</attribute>
</td>

To see if the field priority is present or has a value, use 'and' and 'or'  as in the example below.

<if test="@priority and @priority != ''">No Priority is set</if>

To test the value of an input field, called Status, and show a message if the value is Open, use the formatting seen in the example below.

<if test="/data/node()/@status='Open'">This shelter is OPEN</if>

To suppress the output of a field but still have it available for <if> test statements:

<if test="1=0"><eocfield name="overdue" /></if>

<otherwise>

Inner HTML is rendered if all <when> tags evaluate to false; parent must be <choose>.

<choose>
<when test="@status='Open'">Open</when>
<when test="@status='Closed'">Closed</when>
<otherwise>Full</otherwise>
</choose>

<value-of>

Displays the value of a field, expression, or other XSL data.

Attribute

Allowed Values

Requirements

Description

select

%filename

Required

Name of the field, prefixed with @.

Example

To capture a username with the <value-of> tag:

<input type="text" name="originator_username" size="40"><attribute name="value"><value-of select="/data/@username"></value-of></attribute></input>

<when>

Resembles the <if> tag; parent must be <choose>. See also <otherwise>.

Attribute

Allowed Values

Requirements

Description

test

CDATA

Required

XSL conditional statement; field names are prefixed with @ and must exist as <eocfield> tags in the view.

You must to post a comment.
Last modified

Tags

Classifications

This page has no classifications.