My vote was going to be to update your EAD-to-HTML style sheet, but if you're dealing with a mix of DTD and schema-associated files, here's a style sheet that should transform your schema files into DTD-associated EAD instead:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
    <!-- include the proper path to your DTD files in the doctype-system attribute-->
    <xsl:output indent="yes" method="xml" encoding="utf-8"
        doctype-public="+//ISBN 1-931666-00-8//DTD ead.dtd (Encoded Archival Description (EAD) Version 2002)//EN"/>
    <xsl:strip-space elements="*"/>

    <!-- Stylesheet to remove all namespaces from a document -->
    <!-- NOTE: this will lead to attribute name clash, if an element contains
        two attributes with same local name but different namespace prefix -->
    <!-- Nodes that cannot have a namespace are copied as such -->
    <!-- template to copy elements -->
    <xsl:template match="*">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@* | node()"/>

    <!-- template to copy attributes -->
    <xsl:template match="@*">
            <xsl:when test="local-name()='schemaLocation'"/>
                <xsl:attribute name="{local-name()}">
                    <xsl:value-of select="."/>

    <!-- template to copy the rest of the nodes -->
    <xsl:template match="comment() | text() | processing-instruction()">


Granted, I just tested this with one file, but it seemed to do the trick.  I found this example online and modified it slightly.  Will that work for you?  

Mark Custer

-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of Eric Lease Morgan
Sent: Tuesday, April 03, 2012 4:18 PM
To: [log in to unmask]
Subject: duplicate an xml file

Using XSLT, how can I duplicate an XML file sans namespaces?

I have a set of valid DTD-based EAD files that I transform into HTML using a XSL stylesheet. Tastes great and less filling.

I now have a set of valid schema-based EAD files but I can't transform them because namespaces get in the way. 

My tentative solution to this problem is to copy the schema-based EAD file to new XML file sans the name spaces, and then transform the result, but my XPath statements are incorrect. This way I can use a single XSL stylesheet for HTML creation.

Here is a schema-based EAD snippet:

  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    xsi:schemaLocation = "urn:isbn:1-931666-22-9"
    xmlns:ns2          = ""
    xmlns              = "urn:isbn:1-931666-22-9"
    xmlns:xsi          = "">
    <eadheader><!-- cool stuff here --></eadheader>
    <archdesc level="collection"><!-- more cool stuff here --></archdesc>

Here is a stylesheet:

  <?xml version='1.0'?>
    <xsl:template match="/">
        <xsl:copy-of select="/ead/eadheader"/>
        <xsl:copy-of select="/ead/archdesc"/>

The stylesheet works great if I remove all the name spaces from the EAD, but I can't do that because that is the whole point of the transformation. What sort of XPath statements do I need in order successful do the copy-of command? 

Eric Lease Morgan
University of Notre Dame