About XADef definitions

An XML Attribute Definition (.XADef) has the same structure as its associated Extensible Markup Language (XML), but some tags with specific extensions are reserved to define the structure and properties of the node.

For example:

In XML-

<test>True</test>

would represent a node called test with the value True.

In XADef-

<test test_TYPE_="BOOL" test_REQUIRED_="1">True</test>

would represent the definition of the same node as being a Boolean that is required and has a default value of True. Such a value will be validated to be either True or False.

The following table defines the XML tags used.

_Type_

Defines the type of the value.

_Type_

Description

Bool

Any valid Boolean value is accepted as input such as, 1, 0, true, false, yes, no, on, and off.

Memo

Multiline text box entry, can be used where more text input is needed. The height of memo text control can be adjusted unlike the String type text box.

String

Single line text entry control.

Float

Decimal value/float.

Int

Integer value.

Hex

Valid hexadecimal value, accepts prefix 0x before the value.

Date

ISO Date entry. Input format accepted as DD/MM/YYYY. Saved to file as ISO format YYYYMMDD

 

To enable interactive date selection box: set _VALIDATIONRULE_=”_LIST_” and _LIST_=

” [DATE]” node attributes.

Time

ISO time entry. Input format accepted as HH/MM/SSSS. Saved to file as ISO format HHMMSSSS.

DateTime

ISO date and time field. Input format accepted as YYYYMMDDTHHMMSS.

Color

RGB as DWORD value. To enable interactive color selection box set _VALIDATIONRULE_=”_LIST_” and _LIST_=” [COLOR]” node attributes.

SUBTYPES

Subtypes values for _TYPE_ let the you skip the validation if the data entry is not required to be entered, by typing in N/R.

For example a user can enter a date or N/R if Not Required.

Date_NR

Input should be a proper Date or N/R if not required.

Time_NR

Time format as described under _TYPE_ = Time, or N/R if not required.

DateTime_NR

ISO date and time format or N/R if not required.

_REQUIRED_

Defines if the value is required or optional. If required then it must be defined.

_VALIDATIONRULE_

This can be a VB function script that defines the range of valid values. The function should be written as CDATA[ at the end of the XADef.

Attributes in the current element are defined by their [name]. If possible, the original value before editing has to be defined by [old.name]. Other attributes are to be defined by their [Xpath]. Alternatively, the following predefined values can be entered for selections based on a list-

_LIST_The value must be a value defined under _LIST_ below.
_LIST_NS_Not strict: A single value can be picked up from the predefined list or any single value can be entered by the user.
_M_LIST_Multiple list: Similar to LIST_ but multiple entries can be selected from the list.
_M_LIST_NS_Multiple list, not strict: Select multiple entries and user defined values.

If validation is to be performed on user values, a script name can be attached to _LIST_NS and M_LIST_NS, followed by a semi-colon. For example:

VALIDATIONRULE_ = _LIST_NS_;scriptname  

This will allow the user to select a value from the list or to enter a user value which will be validated using the script ‘scriptname’. This allows the script to work an input filter to stop any illegal character from coming in.

_NS_

Denotes non-strict. For example, values other than the ones found on the list can be entered by the user.

_RANGE_

The range values should be defined similarly to a _LIST_ range (such as, [min-max]).

_FILE_

Must be a valid file name.

_EXISTING_FILE_

Must be an existing file.

The validation rule is not applied if the value in the XML has a ‘{‘ at the start and ‘}’ at the end, because it is assumed to be a field name.

Language codes

The following three sets of tags can include optional language codes by adding optional ­suffix to the end of the tag: ‘­_XXX_’. XXX can be any of the following predefined, supported primary language codes:

Primary language code

Tag code

Language

Supported

7

DUE

German

v

1

ARA

Arabic

v

12

FRA

French

v

4

CHI

Chinese

X

Note that for all above, the XML header should include the ISO code for the language specified.

At run time, ISXMLUI checks for the current language of the Windows OS and renders the dialog with the respective language text if it is defined with the code in XADef; otherwise, it will default to English.

 

_DESCRIPTION_XXX_

Short description of the attribute used by default as the label in a form. If undefined the node name will be used.

 

_LONGDESCRIPTION_XXX_

Long description of the attribute. Used primarily for the tool tip displayed in the forms.

 

_VALIDATIONTEXT_XXX_

Text displayed if a validation fails.

 

_HELP_XXX_

HTML to be displayed as detailed help for the specified button. This may be accessed via a ‘what’s this’ type tool or by right clicking on the parameter.

 

_UOM_XXX_

Unit of measure. Generally one of the following: m, km, mm, um, cm, deg, and rad.

 

_SOURCE_  

Can be one of the following:

UNDEFUndefined or not defined.
CONSTANTThe value defined cannot be changed.
COMPUTEDThe value is automatically computed as defined in reply to _COMPUTEAS_ and cannot be modified.
COMPUTED_DEFAULTWhen other values change, the value should be recomputed as defined in _COMPUTEAS_  but provided as a default. It can be changed by you.

 

_COMPUTEAS_

VBScript function defined in character data (CDATA) that defines the computation of the attribute based on other attributes that are part of the current section. Similar to _VALIDATION_. The only result can be any valid value. Special values are:

DATE_NOW   YYYY-MM-DD
TIME_NOW   HH:MM:SS
DATE_TIME_NOW   YYYY-MM-DDTHH:MM:SS
%%Environmental Variable%%

 

_LIST_

Defines a “;” delimited list of values to display to the user.

The list, which is semi-colon delimited, can be formatted in such a way that what is shown on the list when the combo-box control is dropped down is different from what is to be saved when the user makes the selection. If you want to have a different value saved when a certain value is selected from the list, have the list formatted the following way-

_LIST_ = “saved:shown; 5:Five; 6:Six”

As shown above, the values to be saved and values to display is separated by a colon per each entry. A back-slash (\) can be used to escape the colon character if it is used as part of a description or name and not as a separator.

The following special values can be defined:

“[FILE=C:\, Text Files |  *.txt]"—Opens up the select file dialog box.

The arguments in are listed in order of "[starting directory, Description | Extension]".

“[DIR]—Display directory select dialog

“[FONT=Name]—Display the font dialog to select the name of font. Arguments can be Name, Style, or Size.

“[COLOR]”—Display color dialog

“[ISSERVICE]”—ArcGIS Image Server image service selection dialog

“[ISITEM]”—ArcGIS Image Server raster item selection dialog

“[DATE]”—Display date dialog

“[TIME]”—Display time dialog

“[DATETIME]”—Display date and time dialog

“[“##-##”]”—defines a list of numbers by range. It is also used as the minimum and  maximum for the _RANGE_

“[PRJ]”—Valid PRJ string. If in the ArcMap environment, this makes use of projection engine dialog box to obtain and validate such a string. Otherwise it uses a dialog similar to FileOpen to extract the content of a PRJ file. If the current directory does not contain a PRJ, then it defaults to  <ProgramFiles>\ArcGIS\Coordinate Systems\. The users may also select a previously selected PRJ and view information about the current selected PRJ.