It is sometimes convenient to organize your rules into groups and be able to select quickly and easily which of those groups are applied by XMLProbe. One way to structure your rulesets to enable this is to use XInclude.
First, the XInclude namespace must be declared in your SILCN instance:
<!--my-ruleset.xml-->
<silcn:silcn
xmlns:silcn="http://silcn.org/200309"
xmlns:probe="http://xmlprobe.com/200312"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!--etc.-->You are then free to make use of XInclude mechanisms. Most commonly, the xi:include element instructs the processor to insert the content of an XML document as though it were part of the current document. For instance, this SILCN instance contains a single xi:include element:
<!--my-ruleset.xml-->
<silcn:silcn
xmlns:silcn="http://silcn.org/200309"
xmlns:probe="http://xmlprobe.com/200312"
xmlns:xi="http://www.w3.org/2001/XInclude">
<silcn:version>1.0</silcn:version>
<!--etc.-->
<xi:include href='include-me.xml'/>
</silcn:silcn>where the document located at include-me.xml contains all the rules for this ruleset:
<!--include-me.xml-->
<silcn:selection xmlns:silcn="http://silcn.org/200309" xmlns:probe="http://xmlprobe.com/200312">
<silcn:expression-language-declaration>
<silcn:name>XPath</silcn:name>
<version>1.0</version>
</silcn:expression-language-declaration>
<silcn:set-criterion>
<silcn:id>root</silcn:id>
<silcn:expression>/</silcn:expression>
<probe:message><probe:eval>name( /* )</probe:eval></probe:message>
</silcn:set-criterion>
</silcn:selection>When XMLProbe processes my-ruleset.xml, the contents of include-me.xml are included as part of the ruleset and are evaluated as usual.
The root element of your ruleset must be a silcn element in the SILCN namespace (http://silcn.org/200309). So you can't use a document like this - containing a single xi:include element - to import the entire ruleset:
<!--WRONG-->
<xi:include xmlns:xi='http://www.w3.org/2001/XInclude' href='my-ruleset.xml'/>To be XInclude-compliant, the included document must be well-formed XML. This means that if you include more than one silcn:criterion, they must be wrapped in a silcn:selection.
Don't forget to declare any namespace prefixes used in included documents – the processor won't automatically declare them for you.
When segmenting your SILCN instance, remember to keep it valid to the SILCN schema; XMLProbe will report any errors in the SILCN instance at runtime.