Re: [CODE4LIB] OAI Crosswalk XSLT
2014-07-11 16:38 GMT+02:00 Matthew Sherman matt.r.sher...@gmail.com: have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example Hi, element1/element2 - means, that element2 is child of element1 element[@name='type'] - matches element name=type. @name is shortcut for the name attribute of the element xsl:for-each - is a for each loop. The select part is an xpath expression, and what it matches will be accessed by the xsl:value-of select=. /. All in all, the whole loop put every element into the dc:type tag. Regards, Péter -- Péter Király software developer Europeana - http://europeana.eu eXtensible Catalog - http://eXtensibleCatalog.org
Re: [CODE4LIB] OAI Crosswalk XSLT
Hi Matt, The W3C Recommendation for XPath has some good explanation and examples for abbreviated XPath syntax here: http://www.w3.org/TR/xpath-30/#abbrev Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Matthew Sherman Sent: Friday, July 11, 2014 10:39 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: [CODE4LIB] OAI Crosswalk XSLT Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type']/doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
I guess it is the doc:element/doc:element/doc:field thing that is mostly what it throwing me. On Fri, Jul 11, 2014 at 10:52 AM, Dunn, Katie dun...@rpi.edu wrote: Hi Matt, The W3C Recommendation for XPath has some good explanation and examples for abbreviated XPath syntax here: http://www.w3.org/TR/xpath-30/#abbrev Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Matthew Sherman Sent: Friday, July 11, 2014 10:39 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: [CODE4LIB] OAI Crosswalk XSLT Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type']/doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
The source model seems inordinately complex. On Fri, Jul 11, 2014 at 10:53 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: I guess it is the doc:element/doc:element/doc:field thing that is mostly what it throwing me. On Fri, Jul 11, 2014 at 10:52 AM, Dunn, Katie dun...@rpi.edu wrote: Hi Matt, The W3C Recommendation for XPath has some good explanation and examples for abbreviated XPath syntax here: http://www.w3.org/TR/xpath-30/#abbrev Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Matthew Sherman Sent: Friday, July 11, 2014 10:39 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: [CODE4LIB] OAI Crosswalk XSLT Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type']/doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
Hi Matt, Michael Kays' XSLT 2.0 and XPath 2.0 is a great reference and is available as an eBook. Mulberry Technologies has some quick reference guides [1] that might be helpful. Cheers, Bridger doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- [1] http://www.mulberrytech.com/quickref/ On Fri, Jul 11, 2014 at 10:38 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type']/doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
Matt said: I guess it is the doc:element/doc:element/doc:field thing that is mostly what it throwing me. More DSpacey people than I can probably comment more knowledgeably on this, but this seems like less of an OAI-PMH thing than a DSpace thing. It looks like maybe DSpace stores metadata internally in a generic metadata/element/field structure like Bridger showed (with doc namespace): doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- ...and the select is pulling the information it needs for the dc:type / element in the OAI-PMH output out of the internal DSpace structure. Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Bridger Dyson-Smith Sent: Friday, July 11, 2014 10:56 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] OAI Crosswalk XSLT Hi Matt, Michael Kays' XSLT 2.0 and XPath 2.0 is a great reference and is available as an eBook. Mulberry Technologies has some quick reference guides [1] that might be helpful. Cheers, Bridger doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- [1] http://www.mulberrytech.com/quickref/ On Fri, Jul 11, 2014 at 10:38 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type'] /doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
Ok, that makes sense. While I knew of OAI-PMH this is my first time really getting my hands dirty with it so I wasn't sure if this exceptionally detailed formatting was a function of the OAI protocols or a function of DSpace. I also extracted a metadata record from DSpace to see how they are formatting it and this I what I found for the type field: dcvalue element=type qualifier=none language=Poster/dcvalue On Fri, Jul 11, 2014 at 11:08 AM, Dunn, Katie dun...@rpi.edu wrote: Matt said: I guess it is the doc:element/doc:element/doc:field thing that is mostly what it throwing me. More DSpacey people than I can probably comment more knowledgeably on this, but this seems like less of an OAI-PMH thing than a DSpace thing. It looks like maybe DSpace stores metadata internally in a generic metadata/element/field structure like Bridger showed (with doc namespace): doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- ...and the select is pulling the information it needs for the dc:type / element in the OAI-PMH output out of the internal DSpace structure. Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Bridger Dyson-Smith Sent: Friday, July 11, 2014 10:56 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] OAI Crosswalk XSLT Hi Matt, Michael Kays' XSLT 2.0 and XPath 2.0 is a great reference and is available as an eBook. Mulberry Technologies has some quick reference guides [1] that might be helpful. Cheers, Bridger doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- [1] http://www.mulberrytech.com/quickref/ On Fri, Jul 11, 2014 at 10:38 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type'] /doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
Given the DSpace Dublin Core formatting I would like to be able to take this: dcvalue element=*publication* qualifier=*issue* language=1/dcvalue dcvalue element=*publication* qualifier=*name* language=Quarterly Review of Economics and Finance/dcvalue dcvalue element=*publication* qualifier=*volume* language= 47/dcvalue And turn during a OAI harvest turn it into: dc:identifierQuarterly Review of Economics and Finance Vol. 47 Issue 1/dc:identifier I am thinking I can just add dc:identifierxsl:value-of select=/ Vol. xsl:value-of select=/ Issue xsl:value-of select=//dc:identifier in the identifier section of the cross walk, but I am not 100% sure. Also I am not sure if I will need to use the excessively complex XPath to reference my source values. Can anyone tell me if I am on the right track? On Fri, Jul 11, 2014 at 11:13 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Ok, that makes sense. While I knew of OAI-PMH this is my first time really getting my hands dirty with it so I wasn't sure if this exceptionally detailed formatting was a function of the OAI protocols or a function of DSpace. I also extracted a metadata record from DSpace to see how they are formatting it and this I what I found for the type field: dcvalue element=type qualifier=none language=Poster/dcvalue On Fri, Jul 11, 2014 at 11:08 AM, Dunn, Katie dun...@rpi.edu wrote: Matt said: I guess it is the doc:element/doc:element/doc:field thing that is mostly what it throwing me. More DSpacey people than I can probably comment more knowledgeably on this, but this seems like less of an OAI-PMH thing than a DSpace thing. It looks like maybe DSpace stores metadata internally in a generic metadata/element/field structure like Bridger showed (with doc namespace): doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- ...and the select is pulling the information it needs for the dc:type / element in the OAI-PMH output out of the internal DSpace structure. Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Bridger Dyson-Smith Sent: Friday, July 11, 2014 10:56 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] OAI Crosswalk XSLT Hi Matt, Michael Kays' XSLT 2.0 and XPath 2.0 is a great reference and is available as an eBook. Mulberry Technologies has some quick reference guides [1] that might be helpful. Cheers, Bridger doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- [1] http://www.mulberrytech.com/quickref/ On Fri, Jul 11, 2014 at 10:38 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type'] /doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
Thanks, that is very helpful. On Fri, Jul 11, 2014 at 1:30 PM, Bridger Dyson-Smith bdysonsm...@gmail.com wrote: Hi Matthew, That looks good to me. The only thing I might suggest -- depending on your needs -- is to add xsl:text around your literals; e.g. xsl:value-of select=dcvalue[@qualifier='name']/xsl:text Vol. /xsl:textxsl:value-of select=dcvalue[@qualifier='volume']/xsl:text Issue /xsl:textxsl:value-of select=dcvalue[@qualifier='issue']/ If the processor you are using does something weird with white space, you'll avoid it by having the white space in text element. You may need a more precise XPath, depending on the context of your template, but the initial statement didn't look to bad. Hope that helps. Best, Bridger On Fri, Jul 11, 2014 at 11:24 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Given the DSpace Dublin Core formatting I would like to be able to take this: dcvalue element=*publication* qualifier=*issue* language=1/dcvalue dcvalue element=*publication* qualifier=*name* language=Quarterly Review of Economics and Finance/dcvalue dcvalue element=*publication* qualifier=*volume* language= 47/dcvalue And turn during a OAI harvest turn it into: dc:identifierQuarterly Review of Economics and Finance Vol. 47 Issue 1/dc:identifier I am thinking I can just add dc:identifierxsl:value-of select=/ Vol. xsl:value-of select=/ Issue xsl:value-of select=//dc:identifier in the identifier section of the cross walk, but I am not 100% sure. Also I am not sure if I will need to use the excessively complex XPath to reference my source values. Can anyone tell me if I am on the right track? On Fri, Jul 11, 2014 at 11:13 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Ok, that makes sense. While I knew of OAI-PMH this is my first time really getting my hands dirty with it so I wasn't sure if this exceptionally detailed formatting was a function of the OAI protocols or a function of DSpace. I also extracted a metadata record from DSpace to see how they are formatting it and this I what I found for the type field: dcvalue element=type qualifier=none language=Poster/dcvalue On Fri, Jul 11, 2014 at 11:08 AM, Dunn, Katie dun...@rpi.edu wrote: Matt said: I guess it is the doc:element/doc:element/doc:field thing that is mostly what it throwing me. More DSpacey people than I can probably comment more knowledgeably on this, but this seems like less of an OAI-PMH thing than a DSpace thing. It looks like maybe DSpace stores metadata internally in a generic metadata/element/field structure like Bridger showed (with doc namespace): doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- ...and the select is pulling the information it needs for the dc:type / element in the OAI-PMH output out of the internal DSpace structure. Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Bridger Dyson-Smith Sent: Friday, July 11, 2014 10:56 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] OAI Crosswalk XSLT Hi Matt, Michael Kays' XSLT 2.0 and XPath 2.0 is a great reference and is available as an eBook. Mulberry Technologies has some quick reference guides [1] that might be helpful. Cheers, Bridger doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- [1] http://www.mulberrytech.com/quickref/ On Fri, Jul 11, 2014 at 10:38 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type'] /doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make
Re: [CODE4LIB] OAI Crosswalk XSLT
on this, but this seems like less of an OAI-PMH thing than a DSpace thing. It looks like maybe DSpace stores metadata internally in a generic metadata/element/field structure like Bridger showed (with doc namespace): doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- ...and the select is pulling the information it needs for the dc:type / element in the OAI-PMH output out of the internal DSpace structure. Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Bridger Dyson-Smith Sent: Friday, July 11, 2014 10:56 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] OAI Crosswalk XSLT Hi Matt, Michael Kays' XSLT 2.0 and XPath 2.0 is a great reference and is available as an eBook. Mulberry Technologies has some quick reference guides [1] that might be helpful. Cheers, Bridger doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- [1] http://www.mulberrytech.com/quickref/ On Fri, Jul 11, 2014 at 10:38 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type'] /doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman
Re: [CODE4LIB] OAI Crosswalk XSLT
language=Poster/dcvalue On Fri, Jul 11, 2014 at 11:08 AM, Dunn, Katie dun...@rpi.edu wrote: Matt said: I guess it is the doc:element/doc:element/doc:field thing that is mostly what it throwing me. More DSpacey people than I can probably comment more knowledgeably on this, but this seems like less of an OAI-PMH thing than a DSpace thing. It looks like maybe DSpace stores metadata internally in a generic metadata/element/field structure like Bridger showed (with doc namespace): doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- ...and the select is pulling the information it needs for the dc:type / element in the OAI-PMH output out of the internal DSpace structure. Katie -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Bridger Dyson-Smith Sent: Friday, July 11, 2014 10:56 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] OAI Crosswalk XSLT Hi Matt, Michael Kays' XSLT 2.0 and XPath 2.0 is a great reference and is available as an eBook. Mulberry Technologies has some quick reference guides [1] that might be helpful. Cheers, Bridger doc:metadata doc:element name=example !-- ignored! -- doc:element name=dc doc:element name=blahBlahBlah !-- ignored! -- doc:element name=type doc:element doc:element doc:field name=value !-- get the value of this element -- [1] http://www.mulberrytech.com/quickref/ On Fri, Jul 11, 2014 at 10:38 AM, Matthew Sherman matt.r.sher...@gmail.com wrote: Hi Code4Lib folks, I have a question for those of you who have worked with OAI-PMH. I am currently editing our DSpace OAI crosswalk to include a few custom metadata field that exist in our repository for publication information and port them into a more standard format. The problem I am running into is the select statements they use are not the typical XPath statements I am used to. For example: xsl:for-each select=doc:metadata/doc:element[@name='dc']/doc:element[@name='type'] /doc:element/doc:element/doc:field[@name='value'] dc:typexsl:value-of select=. //dc:type /xsl:for-each I know what the . does, but the other select statement is a bit foreign to me. So my question is, does anyone know of some reference material that can help me make sense of this select? I need to understand what it is doing so I can make my own. Thanks for any insight you can provide. Matt Sherman