By default, the name of a property in the XHTML output is the same as its name in the repository. So in the example shown in the Definition File Format section, the firstName
property of the user
item appears in the XHTML as firstName
. The properties of child items are given output names relative to the top-level item, so the postalCode
property of the homeAddress
item appears in the XHTML as homeAddress.postalCode
.
You can give a property a different name in the XHTML by using the output-name
attribute of the property
element. For example, if you are indexing addresses that are all in the United States, you might want to do this:
<property name="postalCode" output-name="zipCode"/>
Note that if you specify output-name
for a property of a child item, the name of the parent item is not prefixed to the output name. So in this example, the property in the XHTML would actually be zipCode
, not homeAddress.zipCode
. If you want the prefix to be included, you need to specify it explicitly, by setting output-name
to homeAddress.zipCode
.