[XML4Lib] MODS default namespace issue

Kevin S. Clarke ksclarke at gmail.com
Wed May 16 09:49:40 EDT 2007


Hi,

Would you post an example document that you are trying to transform
using the LC stylesheets?

Thanks,
Kevin


On 5/16/07, Andrew Ashton <aashton at skidmore.edu> wrote:
> Thanks for the feedback.  I tested this again this morning, this time
> with Saxon, and the results are identical.  I'm sure it is something
> painfully simple, but I'm stumped.  I don't think the problem comes from
> the LC stylesheet, but this is the one I used:
> http://www.loc.gov/standards/mods/v3/MARC21slim2MODS.xsl.  It could be
> that I'm misunderstanding how Xalan and Saxon interpret namespaces by
> default.  Any more suggestions would be greatly appreciated, but I'll
> move on in the hopes that it will become clear.  I strongly suspect that
> I just forgot to carry a "1" somewhere...
>
> --
> Andrew Ashton
> Systems Librarian
> Scribner Library, Skidmore College
> (518)580-5505
>
> -----Original Message-----
> From: xml4lib-bounces at webjunction.org
> [mailto:xml4lib-bounces at webjunction.org] On Behalf Of Clay Redding
> Sent: Tuesday, May 15, 2007 4:08 PM
> To: xml4lib at webjunction.org
> Subject: Re: [XML4Lib] MODS default namespace issue
>
> 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
>
> _______________________________________________
> XML4Lib mailing list
> XML4Lib at webjunction.org
> http://lists.webjunction.org/mailman/listinfo/xml4lib
> _______________________________________________
> XML4Lib mailing list
> XML4Lib at webjunction.org
> http://lists.webjunction.org/mailman/listinfo/xml4lib
>


More information about the XML4Lib mailing list