Previous Topic

Next Topic

The <query> Tag

The <query> tag is an XSL extension that enables you to issue iTQLTM commands from within an XSL stylesheet. For example:

<query>
<!CDATA[[
select $person from <rmi://mysite.com/server1#people>
where $person <http://foo#hasName> 'James Gosling';
]]>
</query>

In This Section

See Also

Descriptors

What are Descriptors?

Advantages and Disadvantages of Descriptors

Namespaces and Descriptors

The <descriptor> Tag

Reserved Parameters

Descriptors FAQ

Common Mistakes

Descriptor Examples

The results, in XML format, are normally transformed into something more suitable for the client or into a presentation format like HTML or PDF. Other Descriptors make calls on a Descriptor to perform a task without needing to know how that task is performed. For example, to return the title of a document in between two <title> tags.

Most commands require parameters, such as the model, to make them reusable across KowariTM instances and models.

The model parameter is inserted in several ways, as outlined in the XSL specification. However, because the command is contained within a CDATA segment, breaking out of it makes the command difficult for people to read. For example:

<query>
<!CDATA[[
select $person from <]]><xsl:variable select="$model"/>
<!CDATA[[> where $person <http://foo#hasName> 'James Gosling';
]]>
</query>

The <query> tag has a workaround to avoid this. If any string in the CDATA section is surrounded by @@ symbols, then the string is replaced with the value of an attribute of the same from within the <query> tag. This is shown in the example below.

<query model="rmi://mysite.com/server1#people">
<!CDATA[[
select $person from <@@model@@> where $person <http://foo#hasName> 'James Gosling';
]]>
</query>

When the Descriptor executes, it substitutes rmi://mysite.com/server1#people for @@model@@ before passing the command to Kowari.

By specifying the parameter as a Descriptor parameter, the value can be passed in by the client. For example:

<query model="{$model}">
<!CDATA[[
select $person from <@@model@@> where $person <http://foo#hasName> 'James Gosling';
]]>
</query>

If the Descriptor is created with a model parameter defined as a string, the query is now portable across models.

These types of substitutions are not limited to models. Any string can be substituted.

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.