A schema document describes one targetNamespace; elementFormDefault="qualified" puts local elements in it too. xs:include adds a document of the same namespace, xs:import another namespace, and xs:override replaces included components (xs:redefine is deprecated). Ignore xsi:schemaLocation hints in incoming files. Including a no-namespace schema into a namespaced one is a chameleon include: its components adopt the new namespace, so catalog.xsd also serves the namespaced feed of Default Namespaces and Scoping:
sed 's|<catalog |<catalog xmlns="https://booknest.example.com/ns/catalog" |' \
booknest-catalog.xml > booknest-catalog-ns.xml
cat > catalog-ns.xsd <<'XSD'
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="https://booknest.example.com/ns/catalog">
<xs:include schemaLocation="catalog.xsd"/>
</xs:schema>
XSD
sed 's#>BN-0005<#>BN-0004<#' booknest-catalog-ns.xml > dup-ns.xml
xmllint --noout --schema catalog-ns.xsd booknest-catalog-ns.xml dup-ns.xmlbooknest-catalog-ns.xml validates dup-ns.xml validates
The duplicate SKU slips through: the unprefixed book/identifier in xs:unique means no namespace, so after the chameleon include it selects nothing. XSD 1.1's xpathDefaultNamespace="##targetNamespace" fixes it (xmlschema 476 then rejected dup-ns.xml; libxml2 3,427 ignores the attribute), so test identity constraints with a bad file.