LISTSERV mailing list manager LISTSERV 16.0

Help for EAD Archives


EAD Archives

EAD Archives


EAD@LISTSERV.LOC.GOV


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

EAD Home

EAD Home

EAD  June 2013

EAD June 2013

Subject:

Re: root element with namespaces in

From:

"Custer, Mark" <[log in to unmask]>

Reply-To:

Encoded Archival Description List <[log in to unmask]>

Date:

Mon, 24 Jun 2013 11:47:48 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (46 lines)

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="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xlink="http://www.w3.org/1999/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".
-->
</xsl:stylesheet>

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">).

Mark


-----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 http://www.loc.gov/ead/ead.xsd"
xmlns:ns2="http://www.w3.org/1999/xlink" xmlns="urn:isbn:1-931666-22-9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

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.

Thanks

Michele
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
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
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

Top of Message | Previous Page | Permalink

Advanced Options