XML Definitions for Exports
These export examples are all from the Student table, so the beginning of the XML 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:
|
|
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:
|
<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:
Could all be output as:
|
|
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. |