Previous Topic

Next Topic

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}"/>

See Also

Descriptors

What are Descriptors?

Advantages and Disadvantages of Descriptors

Namespaces and Descriptors

The <query> Tag

Reserved Parameters

Descriptors FAQ

Common Mistakes

Descriptor Examples

Latest News

Kowari 1.1.0 Pre-release 1 Released

Kowari 1.0.5 Released

Kowari 1.0.4.1 Released

Kowari 1.0.4 Released

DAWG Evaluates iTQL

Kowari article in XML.com

Kowari mentioned on XML.com

Kowari 1.0.3 Released

Kowari Lite Introduced

Kowari 1.0.2 Released

Kowari 1.0.1 Released

View all news items


Open Source logo Tucana Technologies Logo SourceForge.net Logo

© 2001-2004 Tucana Technologies, Inc. Some rights reserved.