You are here: Field Rules Reference > Field Rules Summary > XDD

XDD

Use this field level rule to tell the system the field has been mapped in the XDD database. Use this rule when you have variable fields which are used on multiple sections.

Note The XDD and XDB rules are synonymous. When encountered in a Studio MRL, the XDD is used from the library. If these rules are used in a MRL that is legacy-based, the XDB database is used.

Syntax

XDD ( )

Instead of mapping these identical variable fields, like Name and Address, each time they are used, you can map them once in the XDD database and then map the individual fields to the XDD rule. This tells the system to look in the XDD database for the complete mapping information for those variable fields.

Mapping

You can include an asterisk (*) to tell the system to add a space before it concatenates the search masks. This makes the XDD rule and the token lookup more flexible and lets you use parent/child mapping.

The child can also be another search mask or XPath, instead of just being the rule parameter. To maintain the same search mask for the Child as that shown in the above example, however, you must add an asterisk (*) in front of the Child's data if it was used as a rule parameter.

You must also set up a correct search mask (XPath) syntax if a child's parent references another parent.

Note The use of an asterisk was added in version 11.0. Prior to this change, the system automatically added a comma for you. To make this work for all implementations, the system cannot assume a comma is always needed. For example, you would not want a comma added before the two XPaths are appended together.

Name

Parent

Rule

Data

Child1

Parent2

PrintIf

*A=Accident:C=Casualty

Child2

Parent1

Move_It

,35,ZZZ

Parent2

Parent1

 

,20,ABC

Parent1

 

 

1,HEADREC

Child1 - 1,HEADREC,20,ABC A=Accident:C=Casualty

Because there is no asterisk in Child2's data, the complete search mask for Child2 becomes:

1,HEADREC,35,ZZZ.

Here is an example:

Name

Parent

Rule

Data

Child1

Parent2

PrintIf

*A=Accident:C=Casualty

Child2

Parent1

Move_It

/JHI

Parent1

 

 

!/ABC

Parent2

Parent1

 

/DEF

In this example, the mapping for Child1 becomes:

!/ABC/DEF A=Accident:C=Casualty

The mapping for Child2 becomes:

!/ABC/JHI

In addition, you can name a parent within each child. The set up is similar to that used for token lookup. When using token lookup, the data's portion contains the set up for this. Here is an example:

?Child/Parent

For the XDD rule, the source field name would contain this set up without a question mark.

Name

Parent

Rule

Data

Child

Parent1

PrintIf

*A=Accident:C=Casualty

Child

Parent2

Move_It

/JHI

Parent1

 

 

!/ABC

Parent2

 

 

!/ABC/DEF

The mapping for Child/Parent1 is:

!ABC A=Accident:C=Casualty

The mapping for Child/Parent2 is:

!/ABC/DEF/JHI

Example

You could make the following entries in Studio in the Rule section of the Field Options panel:

In this field...

Enter...

Rule

XDD

Destination Offset

*

Source Name

Name

Source Offset

*

File

*

Length

*

Record

*

Required

*

Overflow Multiplier

*

Overflow

*

Mask

*

Data

*

* No entry is required unless you intend to override the setting that will be inherited when the source field is found in the XDD.

The source file is saved as a number, not an actual file name. It is used in the TblLkup rule and becomes the index to use to find the table you want to look into for this rule. So, if you want to use the TblLkup rule, you must define the source file using the File field under Rule properties.

Note The Record property is not part of the XDD layout. If you leave the File property equal to zero (0), the system uses the table index value in the XDD.

Similarly, to reference a specific source record, you must define SrcRec in the field’s mapping. For example, you may have an overflow detail record which is identified by 1,Detail. For a certain field, however, you want the data from the second detail record to be mapped. In this case, the mapping for this particular field must contain a SrcRec. Otherwise, the data from the first record will be used.

Note SrcRec is only necessary if you know the specific instance of the data that you wish to use. Typical overflow can be mapped in the XDD and does not involve the SrcRec mapped at the field level.

See also