[Metadatalibrarians] xslt question
Riley, Jenn
jenlrile at indiana.edu
Sun Aug 24 12:22:02 PDT 2008
Hi Greta,
The core of the issue here is you're trying to use the default namespace (xmlns="whatever", the one without the namespace prefix on elements) for both the OAI-PMH wrapper and for the MODS elements. How to fix this depends on what method you'll use to deliver these records via OAI-PMH.
If you're using full OAI-PMH data provider software, it will probably handle providing the wrapper for you, so you don't need to worry about outputting it as a result of this transformation. All you'd need in that case would be MODS records that would then be loaded into the data provider. If you have a big XML file with just MODS, then you can use the default namespace (xmlns="http://www.loc.gov/mods/v3") or a specified prefix (xmlns:mods="http://www.loc.gov/mods/v3", along with mods: in front of all the MODS elements). Depending on how you're loading the MODS records into the data provider you might need one big file with <modsCollection> as the root element and lots of <mods> inside, or lots of XML files each with a <mods> root element. For the latter, <xsl:result-document> in XSLT 2.0 is very helpful.
If you do want to output a whole OAI-PMH wrapper around the MODS, you should pick either the wrapper or MODS to be the default namespace (I'm guessing the former is better maybe?). Define that in the root element of the stylesheet (right now it's not defined until opening the wrapper output in the stylesheet, which I think means it's only defined for that template and no others - but this is starting to get beyond my expertise...). Also in the root element of the stylesheet define the prefix for the other format (e.g., xmlns:mods="http://www.loc.gov/mods/v3).
Hope that helps you down the right track...
Jenn
> -----Original Message-----
> From: metadatalibrarians-bounces at lists.monarchos.com
> [mailto:metadatalibrarians-bounces at lists.monarchos.com] On Behalf Of
> Greta de Groat
> Sent: Sunday, August 24, 2008 12:40 PM
> To: metadatalibrarians at lists.monarchos.com
> Subject: [Metadatalibrarians] xslt question
>
> Ok, i'll ask an XSLT question. Just to be clear, i'm not doing
> this for my day job. I'm also volunteering at a small museum and i'm
> trying to teach myself XML/XSLT/OAI by creating and exposing records
> for some museum collections which i'm putting online. So there's
> nobody there on staff who can help.
>
> I'm working with an XSLT 1.0 processor, that's what i have access to
> at the moment. I am trying to work with XML data exported from a
> museum program called PastPerfect (thus the "ppdata" in my files), and
> i'm trying to turn that into MODS. (I'll work on DC when i get this
> one straight). I do get a transformation to happen, but each element
> has a blank namespace declaration in it. For example:
> note xmlns=""
> abstract xmlns=""
> etc.
> And when i try to validate the resulting file (i used the validator at
> http://www.validome.org/xml/) i get zillions of error messages.
> So obviously i have a namespace problem. I'm trying to make a file of
> records that i can expose via OAI-PMH and i don't really know what the
> wrapper or header or namespace elements should look like, i've just
> copied them from harvested records, and since each of those was a
> little different, i didn't know how to put them together:
>
> I put my stylesheet here:
> http://www.stanford.edu/~gdegroat/TestXSLFileLatest.xsl
> and the file i'm trying to transform is here
> http://www.stanford.edu/~gdegroat/PPSPosters82208Edited.xml
>
> If someone could take a look at this and give me a tip on what i'm
> doing wrong, i'd be very grateful. Or if there is some sort of
> template online that could tell me what these elements are supposed to
> look like for a MODS or a Dublin Core record and any necessary OAI
> stuff? I've looked at the OAI documentation, but it's not at a level i
> can understand.
>
> Sorry if this is too elementary!
>
> thanks
> Greta de Groat
>
>
> ----- End forwarded message -----
>
> _______________________________________________
> Metadatalibrarians mailing list
> Metadatalibrarians at lists.monarchos.com
> http://lists.monarchos.com/listinfo.cgi/metadatalibrarians-
> monarchos.com
More information about the Metadatalibrarians
mailing list