The Target Function Set is used to select content based on intended properties of the output.
The canonical URI of this function set is
http://www.daisy.org/z3986/2010/auth/features/select/functionSets/#target.
There are two functions in this set, the format(arg) function and the
consumer(arg) function:
format function
The format(arg) function describes the intended physical format of the
output. The function takes one argument, arg, which must match:
arg := 'BRAILLE' | 'LARGE_PRINT' | 'TALKING_BOOK' | 'EBOOK' | 'PRINT' | string
string := [A-Za-z0-9_]*
An explanation of the allowed values follows:
It is recommended to use arguments from the set of predefined values, but the possibility to use any string as an argument allows for more specialized implementations of this function.
Example:
<sel:select xmlns:sel="http://www.daisy.org/z3986/2010/auth/features/select/#">
<sel:when expr="target:format('BRAILLE')">
<annotation for="table01" property="republisherAnno"> The table on this page, not represented
as a table in the braille version, presents information about ..... </annotation>
</sel:when>
<sel:when expr="target:format('TALKING_BOOK')">
<annotation for="table01" property="republisherAnno"> The information presented in the table
on this page, is in this talking book, presented in the following list of the number of
persons developing the Basivar-Sumeko Syndrom per year </annotation>
<ul>
<li>1950: 23</li>
<li>2010: 80 (estimated)</li>
</ul>
</sel:when>
<sel:otherwise>
<table xml:id="table01">
<caption>Number of persons developing the Basivar-Sumeko Syndrom per year</caption>
<tr>
<th>Year</th>
<th>Number of persons</th>
</tr>
<tr>
<td>1950</td>
<td>23</td>
</tr>
<tr>
<td>2010</td>
<td>80 (estimated)</td>
</tr>
</table>
</sel:otherwise>
</sel:select>
consumer function
The consumer(arg) function describes the intended consumer group of the
output. The function takes one argument, arg, which must match:
arg := 'BLIND' | 'LOW_VISION' | 'DYSLECTIC' | 'DEAF' | 'DEAFBLIND' | 'COGNITIVE' | string
string := [A-Za-z0-9_]*
It is recommended to use arguments from the set of predefined values, but the possibility to use any string as an argument, allows for more specialized implementations of this function.
Example:
<sel:select xmlns:sel="http://www.daisy.org/z3986/2010/auth/features/select/#">
<sel:when expr="target:consumer('BLIND') or target:consumer('DEAFBLIND')">
<annotation for="img02" property="republisherAnno">A photo of the Old Town Hall in Leipzig, Germany.</annotation>
</sel:when>
<sel:when expr="target:language('en')">
</sel:when>
<sel:otherwise />
</sel:select>
language function
The language(arg) function describes the language of the
output. The function takes one argument, language, which must match the
language datatype as defined in
XML Schema Part 2: Datatypes Second Edition.
All descendants of a when element which is using the language(arg) function
inherit the language given in the when parent, unless a descendant explicitly overrides
this inheritance using the xml:lang attribute. In other words, the language(arg) function
has the same semantics as xml:lang in terms of the language inheritance.
Example:
<sel:select xmlns:sel="http://www.daisy.org/z3986/2010/auth/features/select/#">
<sel:when expr="target:language('es')">
<p>Considerando también esencial promover el desarrollo
de relaciones amistosas entre las naciones;</p>
</sel:when>
<sel:when expr="target:language('en')">
<p>Whereas it is essential to promote the development
of friendly relations between nations,</p>
</sel:when>
<sel:otherwise />
</sel:select>
The Parameter Test Function Set is used to test whether a string, the value argument,
is equal to the value of the runtime name parameter.
The canonical URI of this function set is
http://www.daisy.org/z3986/2010/auth/features/select/functionSets/#parameterTest.
This function set contains one function, the parameterTest(name,
value) function. It takes two arguments, both strings:
name argument represents the name of a runtime parameter.
value represents an arbitrary string.
Example:
<sel:select xmlns:sel="http://www.daisy.org/z3986/2010/auth/features/select/#">
<sel:when expr="ptfs:parameterTest('publisher','nlb')">
<p>Copyright © 2009 Norsk lyd- og blindeskriftbibliotek</p>
</sel:when>
<sel:when expr="ptfs:parameterTest('publisher','hks')">
<p>Copyright © 2009 Huseby kompetansesenter</p>
</sel:when>
<sel:otherwise>
<p>Copyright © 2009</p>
</sel:otherwise>
</sel:select>
The Feature Supported Function Set is used to test whether a specific ANSI/NISO Z39.86-2010 Feature is supported by the Processing Agent.
There is one function in this set, the
featureSupported(uri) function. It takes one argument,
uri, which is a string equal to the canonical URI of a
ANSI/NISO Z39.86-2010 Feature.
The canonical URI of this function set is
http://www.daisy.org/z3986/2010/auth/features/select/functionSets/#featureSupported.
Example:
<sel:select xmlns:sel="http://www.daisy.org/z3986/2010/auth/features/select/#">
<sel:when
expr="fsfs:featureSupported('http://www.daisy.org/z3986/2010/auth/features/mathml/0.2/')">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mi>a</mi>
<mo>⁢</mo>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mi>b</mi>
<mo>⁢</mo>
<mi>x</mi>
<mo>+</mo>
<mi>c</mi>
</mrow>
</math>
</sel:when>
<sel:when
expr="fsfs:featureSupported('http://www.daisy.org/z3986/2010/auth/features/ssml/0.2/') and not(fsfs:featureSupported('http://www.daisy.org/z3986/2010/auth/features/mathml/0.2/'))">
<p>The mathematical expression <ssml:phoneme ph="[eih]" alphabet="ipa">a</ssml:phoneme> times x squared plus b times x plus c</p>
</sel:when>
<sel:otherwise>
<p>The mathematical expression ax²+bx+c</p>
</sel:otherwise>
</sel:select>
Note that since Feature URIs are versioned, this function can be used to test support for different versions of the same Feature.
TODO featureSupportedFunctionSet: allow unversioned feature identifiers as params?