Part 1: selection language

selection element

A document conforming to Part 1 of the SILCN ('selection language') must have one or more elements named selection immediately following its version element.

Part 1 structure

Each selection element must have as its first child a expression-language-declaration element, which specifies the expression languages used within that selection element. This is optionally followed by one or more namespace-declaration elements, which define namespace prefixes which may be used within that selection element.

The remainder of the element must consist of one ore more set-criterion elements.

Specifying selection criteria: set-criterion

Each set-criterion specifies a criterion by which nodes of a processed document will be selected. The set-criterion element has two mandatory children:

  • id - uniquely identifies the criterion;

  • expression - gives an expression, conforming to the language specified in the preceding expression-language element, which can be applied to target documents for node selection.

Schemas & Examples

Figure A.1. RELAX NG schema for SILCN

default namespace = "http://silcn.org/200309"

start =
  element silcn {
    element version { text },
    any-well-balanced,
    (selection-model | report-model)+
  }
selection-model =
  element selection {
    expression-language-declaration-model,
    namespace-declaration-model*,
    any-well-balanced,
    set-criterion-model+
  }
set-criterion-model =
  element set-criterion {
    element id { text },
    element expression { any-well-balanced },
    any-well-balanced
  }
report-model =
  element report {
    expression-language-declaration-model,
    namespace-declaration-model*,
    any-well-balanced,
    matched-set-model+
  }
matched-set-model =
  element matched-set {
    element id { text },
    element node {
      element expression { any-well-balanced },
      any-well-balanced
    }+
  }
namespace-declaration-model =
  element namespace-declaration {
    element uri { text },
    element prefix { text }
  }
expression-language-declaration-model =
  element expression-language-declaration {
    element name { text },
    any-well-balanced
  }
# this model matches any well-balanced XML, or none
any-well-balanced =
  (text
   | element * {
       (attribute * { text }
        | text
        | any-well-balanced)*
     })*

Figure A.2. Example SILCN Part 1 ("selection") instance

<?xml version='1.0'?>

<silcn:silcn xmlns:silcn='http://silcn.org/200309'>

<silcn:version>1.0</silcn:version>

<silcn:selection>

<silcn:expression-language-declaration>
 <silcn:name>XPath</silcn:name>
 <version xmlns='http://foo.org'>1.0</version>
</silcn:expression-language-declaration>

<silcn:namespace-declaration>
 <silcn:uri>http://www.w3.org/1999/xhtml</silcn:uri>
 <silcn:prefix>xh</silcn:prefix>
</silcn:namespace-declaration>

<silcn:set-criterion>
 <silcn:id>40010</silcn:id>
 <silcn:expression>//xh:img[not(@alt)]
            |//xh:input[not(@alt)]
            |//xh:applet[not(@alt)]</silcn:expression>
 <msg>Element <eval>name()</eval> should have an alt attribute.</msg>
</silcn:set-criterion>

</silcn:selection>

</silcn:silcn>