Print

Print


Erik Hetzner wrote:
> At Tue, 29 May 2007 17:07:27 -0700,
> Erik Hetzner wrote:
>   
>> At Tue, 29 May 2007 16:25:14 -0700,
>> Mark Jordan <[log in to unmask]> wrote:
>>     
>>> Hello,
>>>
>>> I am validating the following MODS document against a local copy of
>>> http://www.loc.gov/standards/mods/xml.xsd (using "xmllint --schema
>>> xml.xsd record.xml"):
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <mods xmlns:mods="http://www.loc.gov/mods/v3">
>>>       
>> This should be <mods:mods>
>>     
>  
> Sorry, this might be unclear. What I meant was, this should be:
>
> <?xml version="1.0" encoding="UTF-8"?>                                                                                                                  
> <mods:mods xmlns:mods="http://www.loc.gov/mods/v3"> 
>
> It’s a little strange, but you can use a prefix in the element that
> you declare it in.
>
> best,
> Erik Hetzner
> ;; Erik Hetzner, California Digital Library
> ;; gnupg key id: 1024D/01DB07E3
>   
Hi Erik,

This doesn't work for me:

markslaptop>xmllint --schema xml.xsd record.xml

<?xml version="1.0" encoding="UTF-8"?>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v3">
   <mods:titleInfo>
      <mods:title>A Jewel of Honesty</mods:title>
   </mods:titleInfo>
   <mods:genre>Article</mods:genre>
   <mods:abstract>clashing oppositions</mods:abstract>
   <mods:subject>
      <mods:geographic>N/A</mods:geographic>
   </mods:subject>
   <mods:subject authority="none">
      <mods:topic>General interest</mods:topic>
   </mods:subject>
   <mods:relatedItem type="host">
      <mods:titleInfo>
         <mods:title>Carnegie Newsletter</mods:title>
         <mods:title type="issue">Celebration a Spectacle of 
Hope</mods:title>
      </mods:titleInfo>
      <mods:name>
         <mods:namePart>Pra'N'Ava</mods:namePart>
         <mods:role>
            <mods:roleTerm authority="marcrelator" 
type="text">author</mods:roleTerm>
         </mods:role>
      </mods:name>
      <mods:name>
         <mods:namePart>N/A</mods:namePart>
         <mods:role>
            <mods:roleTerm authority="chodarr" 
type="text">recipient</mods:roleTerm>
         </mods:role>
      </mods:name>
      <mods:part>
         <mods:extent unit="pages">
            <mods:list>9,14</mods:list>
            <mods:start>9</mods:start>
         </mods:extent>
      </mods:part>
      <mods:originInfo>
         <mods:dateIssued encoding="iso8601">19870101</mods:dateIssued>
      </mods:originInfo>
   </mods:relatedItem>
</mods:mods>
Element mods not declared
Element mods not declared
record.xml fails to validate

http://www.loc.gov/standards/mods/v3/mods-userguide-intro.html#xml_structures 
says that '<mods: mods xmnls:mods="http://www.loc.gov/mods/v3"> with 
filename mods-3-2.xsd.' should work when using 'mods' as a prefix to 
each element (as I am, since I will be inserting my MODS records in an 
OAI static repository file). However, the space after '<mods:' in the 
namespace declaration doesn't work either. I've tried including the 
filename 'mods-3-2.xsd' (for a fully qualified URL) in the schema URL as 
well with no luck.

Mark