Jump to content

Using <ref> to point to footnote content


Recommended Posts

Hello All!


My question concerns itself with finding a method for encoding content for footnotes that does not encode the content "inline." That is, I would like to tag a word or group of words to be annotated with a <ref> tag that points to the footnote content that has been encoded elsewhere in the xml document.


The motivation for this is to create XHTML that allows the user to view the footnotes simply by hovering over the annotated words with their cursor. How should I best encode my content to make this possible?


I believe the <ref> tag to be necessary because it allows me to reference the word or words in their entirety rather than simply referencing a point in the xml doc like ptr or anchor would do.


I've attempted to recreate TEI documentation like:


annotated text <ref target="#a51" type="noteAnchor">¹</ref>

<!-- ... -->

<note xml:id="a51" type="footnote">text of annotation</note>


However, when I encode the <note> value after the last line group of the text, a lone superscript appears in the XHTML output where the <note> tag appears in the XML doc... maybe this is an XSL issue? Should I encode the <note> values in the <back> section?


Advice? Suggestions?


Thank you!

XML Newbie

Link to comment
Share on other sites

This does not look like XHTML. Tags like <ref> and <note> don't do anything unless the reader is programmed to do something with them, which an ordinary browser won't.


If your document is being interpreted by some other program other than a browser then you will have to tell me what it is.


To do the behavior you're expecting in a browser you need to write Javascript to do it.

Link to comment
Share on other sites

Ah, yes, I neglected to specify that this encoding is taking place within an XML document, transformed with XSL... I'm aware that the hover function is implemented using Javascript; my concern is encoding the information within XML such that the footnotes are associated with the word or words to be annotated and then are accessible for the hover function later on.

Link to comment
Share on other sites

In that case I'd need to see your XSL stylesheet to be sure.


What does the resulting XHTML look like after the XML has been transformed?


The only important part is that the necessary information is available in the resulting XHTML.

Link to comment
Share on other sites

  • 3 weeks later...

Thanks for replying Foxy Mod. I'm new to xsl, but this is what I've written so far:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xpath-default-namespace="http://www.tei-c.org/ns/1.0">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
                <meta charset="UTF-8"/>
                <meta name="author" content="{TEI/teiHeader/fileDesc/titleStmt/respStmt/name}"/>
                <title>World War I Immigrant Poetry: <xsl:value-of select="TEI/teiHeader/fileDesc/sourceDesc/bibl/title[@type='poemTitle']"/></title>
                <xsl:if test="//note[@place='bottom']">
                    <p style="color:teal; font-size:120%">Notes</p>
                    <xsl:for-each select="//note[@place='end']">
                        <xsl:apply-templates  select="."  mode="shownotes"/>
                <h1>World War I Immigrant Poetry</h1><hr/><br/>
                <p>Title: <i><xsl:value-of select="TEI/text/body/head"/></i></p>
                <p>By: <xsl:value-of select="TEI/teiHeader/fileDesc/titleStmt/author"/></p><br/><hr/><br/>

                    <xsl:for-each select="TEI/text/body/lg/lg">
                        <xsl:for-each select="l">
                            <pre><xsl:value-of select="."/></pre>

I found the <xsl: if.... section online and am trying to fit it into what I've already written to handle the footnotes in a basic way. I've only managed a basic transformation into XHTML and the first paragraph comes out looking like:


Frankreich und Russland — das gilt uns gleich.


'S giebt Böses und Gutes in jedem Reich!


— England allein steht vor Gericht,


ThemisIn Greek mythology, Themis is a goddess, daughter of Uranus (Heaven) and Gaia (Earth). In Homer she personifies order and justice. wägt mit verhülltem Gesicht.


— Hier IrlandAs part of the United Kingdom of Great Britain and Ireland, Ireland joined the war in 1914 with the other two major Entente powers (France and the Russian Empire). — da Belgien!Germany invaded neutral Belgium on 4 August 1914, prompting Britain to declare war on Germany. The British army was based largely in Flanders, which saw some of the highest casualties during WWI. — — Bist du bereit?


Sag uns, was lauter zum Himmel schreit,


O England!



----In the XML, the footnotes are encoded using the <note> tag, and I'm having trouble telling xsl what to do with the contents of the <note> tag. As you can see from above, the English annotations appear right next to the German poetry. What would you suggest?

Edited by PoetryProject
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...