[XML4Lib] MODS default namespace issue

Clay Redding clay at monarchos.com
Tue May 15 16:07:35 EDT 2007


I don't use Xalan much, but what you're describing sounds like Xalan is
not doing something correctly with namespaces.  The only thing that I'm
aware of with regard to Xalan usage with MODS is that it has a tendency
to do wonky things with the xlink:type attribute by unqualifying it and
appending @type='simple' onto given MODS elements, where 'simple' is not
a proper enumerated value in the schema for MODS @type.  Once again, it
appears to be namespace confusion.

If the stylesheet specifies:

xmlns="http://www.loc.gov/mods/v3"

then the elements should be unqualified, a la <modsCollection>

If you have:

xmlns:mods="http://www.loc.gov/mods/v3"

then all elements would require the prefix, such as
<mods:modsCollection>

Which LC stylesheet(s) is (are) giving you the problem?  I can help you
troubleshoot.

Clay

On Tue, 2007-05-15 at 16:49 -0400, Andrew Ashton wrote:
> Hi, 
>  
> I'm going to delurk for a moment to vent & ask a question.  I've been
> working with doing some MARCXML->MODS transforms and then doing some
> further XSLT on the MODS records.  I have tried transforming the MARC
> data using both SIMILE's nifty RDFizer tool [1] and LoC's MARC2MODS
> stylesheets [2] via Xalan.  In both cases, the Xalan transformations
> fail to match any elements, even with the simplest "Hello World"-type
> effort.  It appears that both of these tools set a default,
> unqualified namespace of xmlns="http://www.loc.gov/mods/v3" in the
> <modsCollection> root element.  Altering the output to qualify the
> namespace as xmlns:mods="http://www.loc.gov/mods/v3" makes it work
> correctly.
>  
> My questions are: Is this still valid MODS?  I had the impression that
> using default namespaces like that were bad form, and Xalan is just
> being a stickler for specificity - is this impression correct?  And
> finally, is there any way to circumvent this problem during the Xalan
> transformation instead of needing to edit the LoC or SIMILE
> stylesheets?
>  
> Thanks!
>  
> [1]http://simile.mit.edu/wiki/RDFizers
> [2]http://www.loc.gov/standards/mods/v3/MARC21slim2MODS.xsl
>  
> --
> Andrew Ashton
> Systems Librarian
> Scribner Library, Skidmore College
> (518)580-5505
>  
> _______________________________________________
> XML4Lib mailing list
> XML4Lib at webjunction.org
> http://lists.webjunction.org/mailman/listinfo/xml4lib



More information about the XML4Lib mailing list