Print

Print


I have just encountered a problem with the MODS 3.0 Schema.
(I'm using the <oXygen/> XML editor which, I think, uses the Xerces parser)


The problem in question is (copying from mods-3-0.xsd):

  <!-- ********** language attribute group definition  ********** -->
  <xsd:attributeGroup name="language">
    <xsd:attribute name="lang" use="optional">
      <xsd:annotation>
        <xsd:documentation>ISO 639-2b</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>

    <!-- ****** HERE!!!!! ******* -->
    <xsd:attribute ref="xml:lang" use="optional"/>

    <xsd:attribute name="script" use="optional"/>
    <xsd:attribute name="transliteration" use="optional"/>
  </xsd:attributeGroup>


The validator "Cannot resolve the name 'xml:lang'..."
Checking the XLM specification at W3C I find this comment:

2.12 Language Identification

[...] A special attribute named xml:lang MAY be inserted in documents to specify
the language used in the contents and attribute values of any element in an XML
document. In valid documents, this attribute, like any other, MUST be declared
if it is used. [...]


So, MODS 3.0 does not declare de xml namespace and that's why the validator
fails.

For an example of how to do it right, I went to XML Schema's own schema
definition at http://www.w3.org/2001/XMLSchema.xsd
I chose this because XML Schemas allow xml:lang for their xsd:documentation

This is how the import it (minus the annotation):

 <xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd">
   <xs:annotation>
     <xs:documentation>
       Get access to the xml: attribute groups for xml:lang
       as declared on 'schema' and 'documentation' below
     </xs:documentation>
   </xs:annotation>
 </xs:import>

     Conectese mas rapido y ahorre hasta un 50%
    Tel. 0909.2030 =>  $0,15 IVA incluido el minuto
______________________________________________________
http://www.internet.com.uy - En Uruguay somos internet


     Conectese mas rapido y ahorre hasta un 50%
    Tel. 0909.2030 =>  $0,15 IVA incluido el minuto
______________________________________________________
http://www.internet.com.uy - En Uruguay somos internet