You Can Do It: Tips For Creating A Stylesheet For Your EAD Records

When implementing EAD, archivists consider encoding findings aids as the easy part. Creating an XSLT stylesheet, in contrast, leaves many archivists feeling out of their element. However, armed with a basic understanding of HTML, a few preparatory steps, and the proper mindset, most archivists are capable of making a user-friendly web presentation for their finding aids.

Research & Resources

Get Inspired: Survey what other institutions have done. Keep track of which aspects you like (content, layout, etc.) and look at websites’ source code (right click > “View page source”) to pinpoint working examples of features you might implement. Visit W3School’s XSLT tutorial to get inspiration from the language’s endless possibilities.

Find Samples: The EAD Cookbook includes stylesheets to use as a foundation for your own. Even if none are a perfect fit, tweaking an existing stylesheet is far easier than starting from scratch.

Ask For Help: Stack Overflow is an invaluable Q&A site for coding problems and SAA has an active EAD listserv with insightful discussions. Many XSLT issues have already been resolved, but if you have an issue that has not already been addressed, post your question; the experts are more than willing to help.

Lessons Learned From Common Problems

Problem: There is difficulty incorporating varying legacy finding aid structures into a stylesheet, especially in the container list section.

Solution: You do not necessarily need a single stylesheet – sometimes it makes sense to create more than one. The differences between assorted collections and even among a small set of finding aids may warrant similar, but separate, stylesheets to accommodate the distinctions.

Lesson: Be flexible. Your stylesheet is a living, breathing document. It will look and act differently as you progress, reevaluate, and update.

Problem: The encoding was not granular enough and content needs to be parsed out from a paragraph of text.

Solution: It may be appropriate to tweak the EAD template, even a “finalized” one. Returning to the template and, for example, changing a paragraph to a list can be a more efficient solution, even if many finding aids have already been encoded.

Lesson: Step back. It is easy to get hyper-focused on finding the perfect code to solve a specific problem. Before doing hours of research and self-teaching, take a step back and reassess the situation.

Problem: The stylesheet validates without errors but a blank page is displayed when the finding aid opens in a web browser.

Solution: One easily overlooked and infrequently discussed answer is to declare the namespace for the EAD schema with a prefix. Associating namespaces with prefixes tells the stylesheet which schemas elements belong to. Otherwise, the stylesheet may think an element like archdesc is from something other than the EAD schema. To do this, assign a prefix to the EAD schema namespace (ex: xmlns:prefix=”urn:isbn:1-931666-22-9”). Then, add the prefix to all EAD elements in the stylesheet (ex: prefix:archdesc). Although this process is not necessary, it is considered best practice.

Lesson: Zero in. Details are important. XSLT is not a forgiving language. The difference between single and double quotation marks (or not adding a prefix to the EAD schema namespace) could mean the difference between a broken stylesheet and a beautiful finding aid.

About the author

Justin Snow received his BLS in Aesthetics at Salem State College. He is currently enrolled in Simmons College Graduate School of Library and Information Science concentrating in archives and is also working at Simmons as the archives assistant.

%d bloggers like this: