In the examples considered up till now the XML instance documents did not use namespaces.
Now let's consider creating Schematron schemas for XML instance documents that use namespaces
Example
Here's the classification example that we saw earlier, but it is modified so that all the
elements are in a (default) namespace:
<?xml version="1.0"?>
<Document xmlns="http://www.example.org"
classification="secret">
<Para classification="unclassified">
One if by land, two if by sea;
</Para>
</Document>
Specifying the Namespace
At the beginning of the Schematron schema add a <sch:ns> element. It has two attributes: uri and prefix.
With uri you specify a namespace, and with prefix you associate a prefix with the namespace.
Read as: this rule applies to a Para element in the ex namespace (http://www.example.org). In
particular, it applies to a Para element that has a classification attribute whose value is 'top-secret'.
Assertion
The assertion's XPath expression must use the prefix: