Я использую это [1] XML-схемы для проверки XML-документа с xmllint:XML: определение типа отсутствует
xmllint --noout --schema mets.xsd metadata.xml
Проверка завершается с
metadata.xml:55: element object: Schemas validity error : Element '{info:lc/xmlns/premis-v2}object', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The QName value '{info:lc/xmlns/premis-v2}file' of the xsi:type attribute does not resolve to a type definition.
metadata.xml:55: element object: Schemas validity error : Element '{info:lc/xmlns/premis-v2}object': The type definition is absent.
Line 55 в metadata.xml :
<premis:object xsi:type="premis:file" xsi:schemaLocation="info:lc/xmlns/premis-v2 http://www.loc.gov/standards/premis/v2/premis-v2-0.xsd">
Однако, есть пример документа для того, что я хочу. Он находится здесь [2].
Когда я проверяю этот пример на схему, возникает та же ошибка проверки.
louis-2-0.xml:80: element object: Schemas validity error : Element '{info:lc/xmlns/premis-v2}object', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The QName value '{info:lc/xmlns/premis-v2}file' of the xsi:type attribute does not resolve to a type definition.
louis-2-0.xml:80: element object: Schemas validity error : Element '{info:lc/xmlns/premis-v2}object': The type definition is absent.
Что мне не хватает?
[1] http://www.loc.gov/standards/mets/mets.xsd
[2] http://www.loc.gov/standards/premis/louis-2-0.xml
Это обосновывающий примером документа Луи-2-0.xml, но я получаю новые ошибки в моем документе. Ваш ответ указал мне в правильном направлении. Благодаря! – Steffen
@ c-m-sperberg-mcqueen Один последующий (не стоит новый вопрос о SO). Я думаю, что объявление пространства имен в louis-2-0.xml, строка 6 является избыточным. Правильно? – Steffen
Кажется, что он дублирует декларацию пространства имен в самых отдаленных сетях: элемент mets, yes. –