[OAI-implementers] Namespaces in elements

Young,Jeff jyoung@oclc.org
Tue, 29 Apr 2003 09:33:59 -0400


Jozef,

I've encountered the same problem. If I remember the incantation properly,
you need to re-specify the dc namespace in the template as you are doing the
transform. For example:

<?xml version="1.0" encoding="utf-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                exclude-result-prefixes="rdf">
  <xsl:output method="xml"
              indent="yes"
              omit-xml-declaration="yes"
              encoding="utf-8" />

<xsl:template match="/">
  start creating your OAI wrapper here
  <xsl:apply-templates match="rdf:RDF"/>
  close your OAI wrapper here
</xsl:template>

<xsl:template match="rdf:RDF" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
http://www.openarchives.org/OAI/2.0/oai_dc.xsd" >
    <xsl:apply-templates select="dc:*"/>
  </oai_dc:dc>
</xsl:template>

<xsl:template match="dc:*" xmlns:dc="http://purl.org/dc/elements/1.1/">
etc.
</xsl:template>
</xsl:stylesheet>

I think that was the trick, but my memory may be faulty.

Jeff

> -----Original Message-----
> From: Jozef Kruger [mailto:jozef@nl.adlibsoft.com]
> Sent: Tuesday, April 29, 2003 7:46 AM
> To: oai-implementers@oaisrv.nsdl.cornell.edu
> Subject: [OAI-implementers] Namespaces in elements
> 
> 
> Hi everybody,
> 
> I just implemented the output of my oai server by transforming our own
> xml format to for example dublin core (each supported output format
> having it's own .xsl stylesheet), however, in the transformed 
> xml MSXML
> has replicated the dublin core namespace for each dc element:
> <dc:title
> xmlns:dc="http://purl.org/dc/elements/1.1/">Walangara</dc:title> 
> Where it was:
> <dc:title>Walangara</dc:title> 
> 
> My question is, is this a problem?
> Hussein's repository explorer does NOT complain about this, 
> so that made
> me feel a little confident.
> 
> Cheers,
> Jozef Kruger (Adlib Information Systems B.V. the Netherlands)
> _______________________________________________
> OAI-implementers mailing list
> List information, archives, preferences and to unsubscribe:
> http://oaisrv.nsdl.cornell.edu/mailman/listinfo/oai-implementers
>