RELAX NG's only built-in types are string and token; datatypeLibrary plugs in XSD's (the xsd: prefix in RNC), with facets as params and except to subtract values. Because a choice can pair an attribute with a content pattern, an attribute's value can decide the content, as the identifier define does: an isbn13 identifier must match 97[89]\d{10}, anything else BN-\d{4}. XSD 1.0 cannot express that:
sed -e 's#<identifier type="sku">BN-0001#<identifier type="isbn13">9781234567890#' \
-e 's#>BN-0002<#>BN-12<#' -e 's#"sku">BN-0003#"isbn13">BN-0003#' \
-e 's#<rating>4.1#<rating>5.5#' -e '0,/role="author"/s//role="writer"/' \
booknest-catalog.xml > bad-feed.xml
jing -c booknest.rnc bad-feed.xml | sed 's#^.*/##'Output
bad-feed.xml:12:40: error: value of attribute "role" is invalid; must be equal to "author" or
"editor"
bad-feed.xml:28:46: error: character content of element "identifier" invalid; must be a string
matching the regular expression "BN-\d{4}"
bad-feed.xml:46:51: error: character content of element "identifier" invalid; must be a string
matching the regular expression "97[89]\d{10}"
bad-feed.xml:75:25: error: character content of element "rating" invalid; must be a decimal
number less than or equal to 5b3's SKU fails under type="isbn13". The ISBN with a wrong check digit passes: patterns cannot do arithmetic, so that rule needs an XSD 1.1 assertion or Schematron.