diff --git a/resources/xproc/repertorium/oais-resolve.xsl b/resources/xproc/repertorium/oais-tei.xsl similarity index 60% rename from resources/xproc/repertorium/oais-resolve.xsl rename to resources/xproc/repertorium/oais-tei.xsl index 7c7fcbc3dba3c180ccbea89b627770e71541d4b5..fe3e36ca1632d89c9f918ad2cd0cbe27283ca5da 100644 --- a/resources/xproc/repertorium/oais-resolve.xsl +++ b/resources/xproc/repertorium/oais-tei.xsl @@ -1,5 +1,7 @@ <xsl:transform version="2.0" + exclude-result-prefixes="#all" xpath-default-namespace="http://www.tei-c.org/ns/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="node() | @*"> @@ -8,6 +10,14 @@ </xsl:copy> </xsl:template> + <xsl:template match="TEI"> + <xsl:copy> + <xsl:attribute name="xsi:schemaLocation">http://www.tei-c.org/ns/1.0 http://selbstzeugnisse.hab.de/repertorium.xsd</xsl:attribute> + <xsl:apply-templates select="@* except @xsi:*"/> + <xsl:apply-templates select="node()"/> + </xsl:copy> + </xsl:template> + <xsl:template match="@ref[starts-with(., '../../register.xml')]"> <xsl:if test="document(.)/idno[@type = 'URI']"> <xsl:attribute name="ref" select="document(.)/idno[@type = 'URI']"/> diff --git a/resources/xslt/repertorium/export-dc.xsl b/resources/xproc/repertorium/oais-tei2dc.xsl similarity index 89% rename from resources/xslt/repertorium/export-dc.xsl rename to resources/xproc/repertorium/oais-tei2dc.xsl index 834ad3aa4ab50b0d1bec1db24d4661a368fb638f..b1f78c11e63d90fbb4194665be4ffa03fac63176 100644 --- a/resources/xslt/repertorium/export-dc.xsl +++ b/resources/xproc/repertorium/oais-tei2dc.xsl @@ -1,14 +1,13 @@ -<xsl:transform version="1.0" - exclude-result-prefixes="tei" +<xsl:transform version="2.0" + exclude-result-prefixes="#all" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:tei="http://www.tei-c.org/ns/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:output method="xml" indent="yes"/> - <xsl:template match="tei:msDesc"> - <oai_dc:dc> + <oai_dc:dc xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> <xsl:apply-templates/> </oai_dc:dc> </xsl:template> @@ -90,7 +89,7 @@ <xsl:template match="tei:msItem"> <dc:type> - <xsl:value-of select="id(substring(@class, 2))/tei:catDesc/tei:term"/> + <xsl:value-of select="document(@class)/tei:catDesc/tei:term"/> </dc:type> <xsl:apply-templates/> </xsl:template> diff --git a/resources/xproc/repertorium/oais.xpl b/resources/xproc/repertorium/oais.xpl index 0e69770e22414f2250888f8ba2c3fe6a6bc21a05..a5dcec077af423fc58d1bbc31c7313e32aa02f03 100644 --- a/resources/xproc/repertorium/oais.xpl +++ b/resources/xproc/repertorium/oais.xpl @@ -1,8 +1,11 @@ <p:declare-step version="1.0" + exclude-inline-prefixes="#all" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:s="http://selbstzeugnisse.hab.de/ns" xmlns:p="http://www.w3.org/ns/xproc"> + <p:serialization method="xml" port="result"/> + <p:import href="library.xpl"/> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> @@ -20,7 +23,7 @@ </p:load> <p:xslt> <p:input port="stylesheet"> - <p:document href="oais-resolve.xsl"/> + <p:document href="oais-tei.xsl"/> </p:input> <p:input port="parameters"> <p:empty/> diff --git a/resources/xproc/repertorium/oais.xsl b/resources/xproc/repertorium/oais.xsl index c3200c37b132984bf79bde7b30af4a3db69e3264..761345eeec5a1c88af065bedcd74c8cf516b0d65 100644 --- a/resources/xproc/repertorium/oais.xsl +++ b/resources/xproc/repertorium/oais.xsl @@ -1,10 +1,13 @@ <xsl:transform version="2.0" xpath-default-namespace="http://www.tei-c.org/ns/1.0" xmlns="http://www.openarchives.org/OAI/2.0/static-repository" + xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:include href="oais-tei2dc.xsl"/> + <xsl:template match="/"> <Repository xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/static-repository http://www.openarchives.org/OAI/2.0/static-repository.xsd"> <Identify> @@ -24,27 +27,42 @@ </oai:metadataFormat> <oai:metadataFormat> <oai:metadataPrefix>tei</oai:metadataPrefix> - <oai:schema>http://selbstzeugnisse.hab.de/daten/oai-repertorium.xsd</oai:schema> + <oai:schema>http://selbstzeugnisse.hab.de/repertorium.xsd</oai:schema> <oai:metadataNamespace>http://www.tei-c.org/ns/1.0</oai:metadataNamespace> </oai:metadataFormat> </ListMetadataFormats> <ListRecords metadataPrefix="tei"> - <xsl:apply-templates/> + <xsl:apply-templates mode="tei"/> + </ListRecords> + <ListRecords metadataPrefix="oai_dc"> + <xsl:apply-templates mode="oai_dc"/> </ListRecords> </Repository> </xsl:template> - <xsl:template match="TEI"> - <oai:record> - <oai:header> - <oai:identifier><xsl:value-of select="concat('oai:selbstzeugnisse.hab.de:', @xml:id)"/></oai:identifier> - <oai:datestamp><xsl:value-of select="format-date(current-date(), '[Y]-[M01]-[D01]')"/></oai:datestamp> - </oai:header> + <xsl:template match="TEI" mode="tei"> + <oai:record> + <xsl:call-template name="header"/> <oai:metadata> <xsl:sequence select="."/> </oai:metadata> </oai:record> </xsl:template> + <xsl:template match="TEI" mode="oai_dc"> + <oai:record> + <xsl:call-template name="header"/> + <oai:metadata> + <xsl:apply-templates select=".//msDesc"/> + </oai:metadata> + </oai:record> + </xsl:template> + + <xsl:template name="header"> + <oai:header> + <oai:identifier><xsl:value-of select="concat('oai:selbstzeugnisse.hab.de:', tokenize(@xml:id, '\.')[3])"/></oai:identifier> + <oai:datestamp><xsl:value-of select="format-date(current-date(), '[Y]-[M01]-[D01]')"/></oai:datestamp> + </oai:header> + </xsl:template> </xsl:transform>