The RULEBASE XML entity
- Last Updated: May 13, 2026
- 2 minute read
- Semaphore
- Documentation
Since a rulebase is an XML file it has to obey XML rules. In particular there has to be a single XML entity (called the root entity) which is the ultimate parent of all entities in the document.
Since rules actually form a graph (known as the rulenet) which is created from the published XML rulebase files by CS this is not a requirement for rules - there may be multiple roots for the graph and these multiple roots may exist within any rulebase file.
NB this is pretty much a definition - a directed graph with no cycles with each node having a single parent except for one root node is a tree.
The <rulebase> XML entity is optionally used to provide a root node within a rulebase file where one doesn’t exist within the rules. (If the rules expressed in the rulebase happen to be a tree the rulebase node may be omitted - but often is present regardless of whether it is required or not)
CS will ignore this <rulebase> entity and will not generate a matching rule node - however it does process any attributes which may then be used by inheritance by any rules which are children of this rule.
By being a useful place (since it is the root node so all rules in the rulebase will descend from this rule) for applying default attributes a convention is often used (but not required) that the language for a rulebase is set on the rulebase entity
<?xml version="1.0" encoding="UTF-8"?>
<rulebase language="english" >
...
</rulebase>
So in this case all rules in the rulebase will inherit the language attribute.
Just to stress this point since setting the language on the rulebase entity is so common that some people have assumed this is the only place in which this may be set there is nothing “special” about this node other than it is the first node in most rulebase files - and so setting a default attribute is convenient here rather than required.