I second Mark's note if you're going to HTML, but a way to do it is to use XSL's processing instructions:
http://www.xml.com/pub/a/2000/09/13/xslt/index.html
Look about halfway down that page for the section about processing instructions.
You may need to add a template match to your XSL to match the root EAD node, create the processing instruction, and then continue applying templates so everything else still works.
Here's some code from an EAD->EAD conversion stylesheet:
<xsl:template match="ead:ead">
<xsl:processing-instruction name="xml-stylesheet">
<xsl:text>type="text/xsl" href="http://nwda-db.orbiscascade.org/xsl/nwda_0.1.xsl"</xsl:text>
</xsl:processing-instruction>
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
The DOCTYPE is handled by <xsl:output> and is output directly after the processing instruction.
Ryan Wick
Information Technology Consultant
Special Collections
Oregon State University Libraries
http://osulibrary.oregonstate.edu/specialcollections
-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of Michele R Combs
Sent: Friday, September 02, 2011 12:24 PM
To: [log in to unmask]
Subject: output prior to DOCTYPE
Anybody know a way to get something to output before the <!DOCTYPE when using an XSL style sheet to go from EAD to HTML? That is:
need some stuff here
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html>
<body>
...
</body>
</html>
Thanks --
Michele
+++++++++++++++
Michele Combs.
Librarian for Manuscripts and Archives Processing.
Special Collections Research Center.
Syracuse University.
315-443-2081.
[log in to unmask]
|