내가 xmllint가있는 XML 문서의 유효성을 검사하기 위해 [1] XML 스키마를 사용하고 있습니다 : metadata.xml에 선 55XML : 유형 정의는 존재하지 않는다
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.
실패를 :
그러나 내가 원하는 것에 대한 예제 문서가 있습니다. 그것은 여기에있다 [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
으로 확인하는 노력하지만, 내 문서에 새로운 오류를 얻을. 당신의 대답은 저에게 올바른 방향으로 지적했습니다. 감사! – Steffen
@ c-m-sperberg-mcqueen 하나의 후속 조치 (SO에 대한 새로운 질문이 없음). 나는 louis-2-0.xml의 6 행에있는 네임 스페이스 선언이 중복 된 것 같아요. 권리? – Steffen
가장 바깥 쪽 mets : names 요소 선언에 네임 스페이스 선언을 복제 한 것 같습니다. –