This is a good question, and the reason why folks often get tripped up when working with namespaces for the first time.  The following example style sheet will work (and the processor you're using won't matter):

<xsl:stylesheet xmlns:xsl=""
    xmlns:xlink="" xmlns:ead="urn:isbn:1-931666-22-9"
    exclude-result-prefixes="xs xsl ead xlink" version="1.0">

<!--add templates here, making sure you preface any element names with the EAD namespace prefix that's declared above (and the Xlink namespace prefix when appropriate).

Example:  match="ead:unittitle", or match="*:unittitle" (where the * stands in for any namespace whatsoever)

If you're using XSLT 2.0 or 3.0, you can declare an "xpath-default-namespace" within the xsl:stylesheet element.  In that case, you wouldn't need to use the ead namespace prefix, so you could still have your templates match like so:  match="unittitle".  

If you strip everything out of the <ead> element, though, you technically no longer have an EAD document.  After you've done that, the XML file is neither associated with the EAD DTD or the schema, and in the case of the latter, it doesn't contain the EAD namespace at all, since you removed the default namespace declaration (i.e. <ead xmlns="urn:isbn:1-931666-22-9">).  


-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of MicheleR
Sent: Saturday, June 22, 2013 6:17 PM
To: [log in to unmask]
Subject: root element with namespaces in

I have never been able to get a style sheet to successfully process an EAD file in which the root element looks like this (i.e., your basic AT export):

<ead xsi:schemaLocation="urn:isbn:1-931666-22-9" 
xmlns:ns2="" xmlns="urn:isbn:1-931666-22-9" 

I always have to strip everything out so that it's just <ead>.

For obvious reasons, this is a PITA.  Is there something I can do so that the style sheet will apply successfully even with all that stuff in there?

Right now I'm using Saxon and my stylesheet is XSL 1.0 if that matters.


The bond that links your true family is not one of blood, but of respect and joy in each other's life. Rarely do members of one family grow up under the same roof.
  -- Richard Bach, Illusions