Print

Print


On Jan 25, 2005, at 4:20 PM, Ray Denenberg, Library of Congress wrote:

>> I'm just still not understanding why there is any need for this,
>
> Take <identifer> for instance. Its mods and mads definitions are
> identical.
> Do we want that defintion in one place, or repeated in all the schemas
> that
> use it?  (If the latter, then there is no need.)

Yes, I understand this bit, but the namespace issues is -- as I just
showed -- a separate issue from the business of a library of patterns
(or at least it is in a pure sense; whether XSD forces you to namespace
your library is yet another separate issue).

So, we have three different questions:

1)  Should elements common to different schemas share common
definitions (clearly the answer is "yes")
2)  Should elements common to different schemas share common namespaces
(the answer here is not at all clear; I'm quite uneasy with the notion
obviously)
3)  How to model the answers to the above two questions in schemas?

With respect to the last, in RNG it's easy either way; don't know about
XSD.  If XSD doesn't allow you to consider this, then you have a fourth
question:

        Which schema language offers the best development language for what
the LoC wants to do?

The answer in this case is clearly not XSD.  It makes no sense to force
a namespace on a common type library.

Incidentally, if I convert my examples schemas to XSD, Trang creates a
namespace-specific library file.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://www.loc.gov/mods"
xmlns:mods="http://www.loc.gov/mods">
   <xs:element name="title" type="xs:string"/>
   <xs:element name="name" type="xs:string"/>
</xs:schema>

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://www.loc.gov/mods"
xmlns:mods="http://www.loc.gov/mods">
   <xs:include schemaLocation="M-Libraryxsd"/>
   <xs:element name="mods">
     <xs:complexType>
       <xs:sequence>
         <xs:element ref="mods:title"/>
         <xs:element ref="mods:name"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
</xs:schema>

Bruce