XML Definitions for Exports

These export examples are all from the Student table, so the beginning of the XMLClosed eXtensible Markup Language Export definition is:

Header

<?xmlversion="1.0"encoding="UTF-8"?>

Table

<exporttable-id="tblStudentheader-row="true" line-separator="windows">

 

For xml-based exports, two entities are available:

Entity

Description

Example

constant

It is simply the constant value and the column header source and value. 

<constant value="The Constant Value"header-source="constant"header-value="Constant Column" />

field

Other than a constant, the source can be:

  • resource
  • javaName
  • databasename
  • longUserName
  • shortUserName
  • default

 

 

Attributes that can be applied in the field entity:

Attribute

Description

Example

transform

The value of the field can be transformed with the following transform values:

  • toupper – converts all alpha to upper case characters
  • tolower – converts all alpha to lower case characters
  • alpha – returns only the characters A through Z (upper and lower case)
  • numeric – returns only digits
  • alphanumeric – returns only A through Z, _ (underscore) and 0 through 9
  • nonalphanumeric – returns everything except alphanumeric
  • none (default) – same as omitting the transform attribute

Note: These cannot be combined, so you cannot return alpha and toupper.

<fieldid="stdFieldB001"transform="tolower" />

 

pad

The pad attribute can be either left or right to indicate to which side of the data the pad character will be placed.  The default pad character is a space.

<fieldid="stdFieldB001"pad="left" pad-charcter="-" length="30" />

The output for the column will be 30 characters in length and padded on the left with the hyphen character.

find

Find works with the replaceFirst and replaceAll attributes. The find string is a Regular Expression.

<fieldid="stdFieldB001"find="[abc]*" replaceAll="X" length="30" />

This example replaces all occurrences of the letters a, b, and/or c with the letter X.

return

The return attribute specifies a Regular Expression. If a match is found in the source data, then that match is returned.

If there were a number of matching groups, only the last group is returned. This allows the use of non-capturing groups such as "(?:.*, )(.*)" a regex that discards everything up to and including the comma-space characters and returns everything after them.

Example:

Lastname, Firstname returns Firstname.

<field id="stdFieldB002" return="\D{1,2}\d{1,2}" />

<field id="stdViewName" return="(?:.*, )(.*)"/>

layout

The layout attribute allows you to use the Regular Expression Library to parse and lay out the data of a field. 

<fieldid="stdFieldB003"layout="phone.us" />

The phone.us expression is used to format phone numbers.  This  expression matches three groups of digits and formats them with parenthesis and hyphens. This is a way to standardize the formatting of data in a field. 

For example, these phone numbers:

  • 7815551234
  • 617-555-6645
  • (508) 555-9945

Could all be output as:

  • (781) 555-1234
  • (617) 555-6645
  • (508) 555-9945

format

 

The format attribute is used to specify the format of dates and numbers.  The format definitions can be found in the Java documentation for the SimpleDateFormat class and the DecimalFormat class. 

For exports:

  <fieldid="stdSpedExitDt"format="yyyy-MM-dd" />

  <field id="stdSpedExitDt" format="EEE, MMM d, ''yy"/>

  <field id="stdSpedExitDt" format="yyyyy.MMMMM.dd GGG"/>

  <field id="stdSpedExitDt" format="MM/dd/yyyy" />

The output might look like:

2022-03-21

Thu, Mar 21, '2022

2022.March.21 AD

03/21/2022

For imports:

  <direct-fieldid="stdSpedNextEv"format="yyyy-MM-dd" />

  <direct-field id="stdSpedLastEv" format="dd-MMM-yyyy" />

The dates can be interpreted in various formats using this attribute.