mulgara - semantic store

skip navigation

SHOW SITE NAV
fixed
fluid
straight

The <descriptor> Tag

The <descriptor> tag is an XSL extension that enables a Descriptor to call another Descriptor and operate on the output of the called Descriptor. Effectively, this allows sub-tasking, or delegation of tasks to other Descriptors whose implementations may evolve over time. For example:

<descriptor _target="http://foo/descriptors/extractPeopleAsHtml.xsl" />

The above tag executes the Descriptor located at http://foo/descriptors/extractPeopleAsHtml.xsl and returns the output into the output stream of the XSL transformer. That is, as if the result of the called (target) Descriptor was part of the source Descriptor.

Note - Any attributes beginning with an underscore (_) are reserved and are internal to the Descriptor.

The _target attribute specifies the Descriptor to invoke and the _source attribute specifies the full URL of the source Descriptor. If the target Descriptor's full URL is not known, it uses the path of the source Descriptor. For example:

<descriptor _target="extractPeopleAsHtml.xsl"
_source="http://foo/descriptors/extractPeopleAndCompaniesAsHTML.xsl" />

This allows Descriptor code to build a complete URL for the target Descriptor. However, since Descriptors do not know their URL until invoked (that is, they are told of their URL) the tag in the above example is more often used as follows:

<descriptor _target="extractPeopleAsHtml.xsl" _source="{$_self}" />

The _self parameter is a special parameter that is passed to all Descriptors on invocation and is set to the URL of the Descriptor. When Descriptors are deployed, they take on the URL they were loaded in as. Therefore, the target Descriptor in the above example is located as long as it is in the same directory as the source Descriptor.

Descriptor parameters are specified as attributes in the <descriptor> tag. In the previous example if a model needed to be specified, the tag could look as follows:

<descriptor _target="extractPeopleAsHtml.xsl" _source="{$_self}" model="{$model}"/>

If some attributes are long, it is preferable to format the tag as follows:

<descriptor
_target="extractPeopleAsHtml.xsl" 
_source="{$_self}"
model="{$model}"/>

Valid XHTML 1.0 TransitionalValid CSS 3.0!