<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns:tei="http://www.tei-c.org/ns/1.0" 
                xmlns:ct="http://comhartaighde.ie/ns/1.0" 
                exclude-result-prefixes="tei ct"
                version="1.0">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" doctype-system="about:legacy-compat" />


<xsl:include href="_variables.xsl" />
<xsl:include href="_typography.xsl" />
<xsl:include href="_components.xsl" />
<xsl:include href="_review_en.xsl" /><!--Leagan Béarla-->
<xsl:include href="_links.xsl" />
<xsl:include href="_citations_en.xsl" /><!--Leagan Béarla-->
<xsl:include href="_multimedia.xsl" />

    
<xsl:template match="/">

<xsl:processing-instruction name="php">
$title = "<xsl:value-of select="//tei:titleStmt/tei:title[@xml:lang='en']"/>";
$description = "<xsl:value-of select="//ct:blurb[@xml:lang='en']"/>";
$sectionID = "eagrain";
$editionID = "<xsl:value-of select="//tei:editionStmt/tei:edition/@n"/>";
$pageID = "<xsl:value-of select="//ct:identifier"/>";
$pageLang = "en";
?</xsl:processing-instruction>
    
<html class="no-js" lang="en">
    <head>
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/head-meta.php");?</xsl:processing-instruction>
        
        <xsl:element name="meta">
            <xsl:attribute name="name">keywords</xsl:attribute>
            <xsl:attribute name="content">
                <xsl:for-each select="//tei:keywords[@xml:lang='en']/tei:term">
                   <xsl:value-of select="."/>
                   <xsl:if test="position() != last()">
                      <xsl:text>, </xsl:text>
                   </xsl:if>
                </xsl:for-each>
            </xsl:attribute>
        </xsl:element>
        
        <xsl:element name="link">
            <xsl:attribute name="rel">alternate</xsl:attribute>
            <xsl:attribute name="hreflang">ga</xsl:attribute>
            <xsl:attribute name="href"><xsl:copy-of select="$thisArticleURL"/></xsl:attribute>
        </xsl:element>
        
        <!--Meiteashonraí tagartha-->
        <xsl:element name="meta">
            <xsl:attribute name="name">citation_title</xsl:attribute>
            <xsl:attribute name="content">
                <xsl:value-of select="//tei:titleStmt/tei:title[@xml:lang='en']"/>
            </xsl:attribute>
        </xsl:element>
        
        <xsl:for-each select="//tei:titleStmt/tei:author">
            <xsl:element name="meta">
                <xsl:attribute name="name">citation_author</xsl:attribute>
                <xsl:attribute name="content">
                    <xsl:value-of select="tei:persName/tei:surname"/>
                    <xsl:text>, </xsl:text>
                    <xsl:value-of select="tei:persName/tei:forename"/>
                </xsl:attribute>
            </xsl:element>
            
            <xsl:element name="meta">
                <xsl:attribute name="name">citation_author_institution</xsl:attribute>
                <xsl:attribute name="content">
                    <xsl:value-of select="tei:affiliation[@xml:lang='en']"/>
                </xsl:attribute>
            </xsl:element>
        </xsl:for-each>
        
        <meta name="citation_journal_title" content="COMHARTaighde" />
        <xsl:if test="count(//tei:publicationStmt/tei:idno[@type='ISSN']) &gt; 0">
            <xsl:element name="meta">
                <xsl:attribute name="name">citation_issn</xsl:attribute>
                <xsl:attribute name="content">
                    <xsl:value-of select="//tei:publicationStmt/tei:idno[@type='ISSN']"/>
                </xsl:attribute>
            </xsl:element>
        </xsl:if>
        
        <xsl:element name="meta">
            <xsl:attribute name="name">citation_date</xsl:attribute>
            <xsl:attribute name="content">
                <xsl:value-of select="//tei:publicationStmt/tei:date"/>
            </xsl:attribute>
        </xsl:element>
        
        <xsl:element name="meta">
            <xsl:attribute name="name">citation_issue</xsl:attribute>
            <xsl:attribute name="content">
                <xsl:value-of select="//tei:editionStmt/tei:edition/@n"/>
            </xsl:attribute>
        </xsl:element>

        <xsl:if test="count(//tei:titleStmt/tei:idno) &gt; 0">
            <xsl:element name="meta">
                <xsl:attribute name="name">citation_doi</xsl:attribute>
                <xsl:attribute name="content">
                    <xsl:value-of select="//tei:titleStmt/tei:idno"/>
                </xsl:attribute>
            </xsl:element>
        </xsl:if>
        
        <xsl:element name="meta">
            <xsl:attribute name="name">citation_fulltext_html_url</xsl:attribute>
            <xsl:attribute name="content"><xsl:copy-of select="$thisArticleURL"/></xsl:attribute>
        </xsl:element>
        <!-- Ba chóir an comhad HTML agus an PDF a chur san fhofhillteán céanna (Treoracha Google Scholar)-->
        <xsl:element name="meta">
            <xsl:attribute name="name">citation_pdf_url</xsl:attribute>
            <xsl:attribute name="content"><xsl:copy-of select="$thisArticleURL"/><xsl:value-of select="//ct:identifier"/>.pdf</xsl:attribute>
        </xsl:element>
        
        <xsl:element name="meta">
            <xsl:attribute name="name">citation_publisher</xsl:attribute>
            <xsl:attribute name="content">
                <xsl:value-of select="//tei:publicationStmt/tei:publisher"/>
            </xsl:attribute>
        </xsl:element>
        
        <xsl:element name="meta">
            <xsl:attribute name="name">dc.identifier</xsl:attribute>
            <xsl:attribute name="content">
                <xsl:value-of select="//tei:titleStmt/tei:idno"/>
            </xsl:attribute>
        </xsl:element>
        
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/head-social.php");?</xsl:processing-instruction>
        
        <!--Íomhánna Open Graph + Twitter-->
        <xsl:choose> 
            <xsl:when test="count(//tei:div[@type='articleContent']/tei:figure) &gt; 0">
                <xsl:for-each select="//tei:div[@type='articleContent']/tei:figure">
                    <xsl:element name="meta">
                        <xsl:attribute name="property">og:image</xsl:attribute>
                        <xsl:attribute name="content"><xsl:copy-of select="$thisArticleURL"/>assets/<xsl:value-of select="tei:graphic[@intent='large-2x']/@url" /></xsl:attribute>
                    </xsl:element>
                    <xsl:element name="meta">
                        <xsl:attribute name="name">twitter:image</xsl:attribute>
                        <xsl:attribute name="content"><xsl:copy-of select="$thisArticleURL"/>assets/<xsl:value-of select="tei:graphic[@intent='large-2x']/@url" /></xsl:attribute>
                    </xsl:element>
                </xsl:for-each>
            </xsl:when>
            <xsl:otherwise>
                <meta property="og:image" content="https://old.comhartaighde.ie/soisialta/baile.png" />
                <meta name="twitter:image" content="https://old.comhartaighde.ie/soisialta/baile.png" />
            </xsl:otherwise>
        </xsl:choose>
        
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/head-global.php");?</xsl:processing-instruction>

        <!-- Clóghrafaíocht le Typekit-->
        <script>
          (function(d) {
            var config = {
              kitId: 'ejo0ibc',
              scriptTimeout: 3000
            },
            h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='//use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&amp;&amp;a!="complete"&amp;&amp;a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
          })(document);
        </script>
    </head>
    <body>
        
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/body-initial.php");?</xsl:processing-instruction>
        
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/facebook-sdk.php");?</xsl:processing-instruction>
        
        <div id="skip"><a href="#content">Skip to main content</a></div>
        
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/navbar.php");?</xsl:processing-instruction>
        
        <article id="content">
            
            <div class="row">
                <header>
                    <p class="articleMeta"><span class="articleType">Issue <xsl:value-of select="//tei:editionStmt/tei:edition/@n"/> | <xsl:value-of select="//ct:articleType[@xml:lang='en']"/></span> <xsl:if test="count(//tei:titleStmt/tei:idno) &gt; 0"> | <span class="citation_doi">DOI: http://dx.doi.org/<xsl:value-of select="//tei:titleStmt/tei:idno"/></span></xsl:if></p>
                    <h1 class="citation_title"><xsl:apply-templates select="//tei:titleStmt/tei:title[@xml:lang='en']"/></h1>
                    <p class="citation_author">
                        <xsl:if test="(//ct:articleType[@xml:lang='en']) = 'Review'">
                            <span class="reviewerLabel">Review:</span>
                            <xsl:text> </xsl:text>
                        </xsl:if>
                        <xsl:copy-of select="$authorNamesEN"/>
                    </p>
                </header>
            </div>
            
            <div class="row">
                
                <section id="metadata" class="no-path" role="contentinfo">
                    <xsl:element name="a">
                        <xsl:attribute name="id">articleDownload</xsl:attribute>
                        <xsl:attribute name="class">button pdf-btn</xsl:attribute>
                        <xsl:attribute name="target">_blank</xsl:attribute>
                        <xsl:attribute name="href">
                            <xsl:text>../</xsl:text>
                            <xsl:value-of select="//ct:identifier"/>
                            <xsl:text>.pdf</xsl:text>
                        </xsl:attribute>
                        <xsl:text>Download PDF</xsl:text>
                    </xsl:element>
                    <ul class="accordion" data-accordion="" role="tablist">
                      <xsl:if test="(//ct:articleType[@xml:lang='en']) = 'Review'">
                        <li class="accordion-navigation">
                            <xsl:choose> 
                                <xsl:when test="count(//ct:reviewObject/tei:bibl) &gt; 1">
                                    <a class="accordion-link" href="#panel0d"  role="tab" id="panel0d-heading" aria-controls="panel0d">Works</a>
                                </xsl:when>
                                <xsl:otherwise>
                                    <a class="accordion-link" href="#panel0d"  role="tab" id="panel0d-heading" aria-controls="panel0d">Work</a>
                                </xsl:otherwise>
                            </xsl:choose> 
                            <div id="panel0d" class="content active" role="tabpanel" aria-labelledby="panel0d-heading">
                                <xsl:apply-templates select="//ct:reviewObject/tei:bibl" />
                            </div>
                        </li>
                      </xsl:if>
                      <li class="accordion-navigation">
                        <a class="accordion-link" href="#panel1d" role="tab" id="panel1d-heading" aria-controls="panel1d">Details</a>
                        <xsl:element name="div">
                            <xsl:attribute name="id">panel1d</xsl:attribute>
                            <xsl:choose>
                                <xsl:when test="(//ct:articleType[@xml:lang='ga']) = 'Léirmheas'">
                                    <xsl:attribute name="class">
                                        <xsl:text>content</xsl:text>
                                    </xsl:attribute>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:attribute name="class">
                                        <xsl:text>content active</xsl:text>
                                    </xsl:attribute>
                                </xsl:otherwise>
                            </xsl:choose>
                            <xsl:attribute name="role">tabpanel</xsl:attribute>
                            <xsl:attribute name="aria-labelledby">panel1d-heading</xsl:attribute>
                            <p class="dataLabel">Published:</p>
                            <p class="pubDate">
                                <xsl:value-of select="//tei:publicationStmt/tei:date/ct:day"/> 
                                <xsl:text> </xsl:text>
                                <xsl:copy-of select="$dateMYEN"/>
                            </p>
                            <xsl:if test="(//ct:articleType[@xml:lang='en']/@status) = 'Peer Reviewed'">
                                <p class="dataLabel">Status:</p>
                                <p class="status"><xsl:value-of select="//ct:articleType[@xml:lang='en']/@status"/></p>
                            </xsl:if>
                            <p class="dataLabel">Keywords:</p>
                            <p class="keywords">
                                <xsl:for-each select="//tei:keywords[@xml:lang='en']/tei:term">
                                   <xsl:value-of select="."/>
                                   <xsl:if test="position() != last()">
                                      <xsl:text>, </xsl:text>
                                   </xsl:if>
                                </xsl:for-each>
                            </p>
                            <xsl:if test="count(//tei:titleStmt/tei:idno) &gt; 0">
                                <p class="dataLabel">DOI:</p>
                                <p class="DOI">http://dx.doi.org/<xsl:value-of select="//tei:titleStmt/tei:idno"/></p>
                            </xsl:if>
                          </xsl:element>
                      </li>
                      <li class="accordion-navigation">
                        <a class="accordion-link" href="#panel2d"  role="tab" id="panel2d-heading" aria-controls="panel2d">Copyright</a>
                        <div id="panel2d" class="content" role="tabpanel" aria-labelledby="panel2d-heading">
                            <xsl:choose>
                                <xsl:when test="(//tei:publicationStmt/tei:availability/tei:licence/@type) = 'author'">
                                    <p>© <xsl:copy-of select="$authorNamesEN"/>, <xsl:value-of select="//tei:publicationStmt/tei:date/ct:year"/></p>
                                    <xsl:choose>
                                        <xsl:when test="(//tei:editionStmt/tei:edition/@n) &lt; 6">
                                            <p>This text of this article may be downloaded and redistributed both in electronic form and in print, provided that the author and journal are properly cited and no fee is charged for access.</p>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <p><xsl:apply-templates select="//tei:publicationStmt/tei:availability/tei:licence[@xml:lang='en']"/></p>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of select="//tei:publicationStmt/tei:availability/tei:licence[@xml:lang='en']"/>
                                </xsl:otherwise>
                            </xsl:choose>
                            <p><a href="/eolas/coipcheart/">More information »</a></p>
                        </div>
                      </li>
                      <li class="accordion-navigation">
                        <xsl:choose> 
                            <xsl:when test="count(//tei:titleStmt/tei:author) &gt; 1">
                                <a class="accordion-link" href="#panel3d"  role="tab" id="panel3d-heading" aria-controls="panel3d">Authors</a>
                            </xsl:when>
                            <xsl:otherwise>
                                <a class="accordion-link" href="#panel3d"  role="tab" id="panel3d-heading" aria-controls="panel3d">Author</a>
                            </xsl:otherwise>
                        </xsl:choose> 
                        <div id="panel3d" class="content" role="tabpanel" aria-labelledby="panel3d-heading">
                            <xsl:for-each select="//tei:titleStmt/tei:author">
                                <p class="dataLabel">Author:</p>
                                <p class="citation_author">
                                    <xsl:value-of select="tei:persName/tei:surname"/>
                                    <xsl:text>, </xsl:text>
                                    <xsl:value-of select="tei:persName/tei:forename"/>
                                </p>
                                <xsl:if test="count(tei:affiliation) &gt; 0">
                                    <p class="dataLabel">Affiliation:</p>
                                    <p class="citation_author_institution"><xsl:value-of select="tei:affiliation[@xml:lang='en']"/></p>
                                </xsl:if>
                                <xsl:if test="count(tei:email) &gt; 0">
                                    <p class="dataLabel">Contact:</p>
                                    <p>
                                        <xsl:element name="a">
                                            <xsl:attribute name="href">
                                                <xsl:text>mailto:</xsl:text>
                                                <xsl:value-of select="tei:email"/>
                                            </xsl:attribute>
                                            <xsl:value-of select="tei:email"/>
                                        </xsl:element>
                                    </p>
                                </xsl:if>
                            </xsl:for-each>
                        </div>
                      </li>
                    </ul>
                    <ul class="socialSharer">
                        <li><p class="shareLabel">Share this article:</p></li>
                        <li class="socialSharing">
                            <a class="facebookSharer">
                                <span class="shareIcon facebookShare">
                                    <img srcset="/img/facebook-share-dubh.png, /img/facebook-share-dubh-2x.png 2x" alt="Scaip an t-alt seo ar Facebook" />
                                </span>
                            </a>
                            <xsl:element name="a">
                                <xsl:attribute name="class">
                                    <xsl:text>twitterSharer</xsl:text>
                                </xsl:attribute>
                                <xsl:attribute name="href">
                                    <xsl:text>https://twitter.com/intent/tweet?url=https%3a%2f%2fcomhartaighde.ie%2feagrain%2f</xsl:text>
                                    <xsl:value-of select="//tei:editionStmt/tei:edition/@n"/>
                                    <xsl:text>%2f</xsl:text>
                                    <xsl:value-of select="//ct:identifier"/>
                                    <xsl:text>%2fen</xsl:text>
                                    <xsl:text>%2f&amp;via=comhartaighde</xsl:text>
                                </xsl:attribute>
                                <xsl:attribute name="target">
                                    <xsl:text>_blank</xsl:text>
                                </xsl:attribute>
                                <span class="shareIcon twitterShare">
                                    <img srcset="/img/twitter-share-dubh.png, /img/twitter-share-dubh-2x.png 2x" alt="Scaip an t-alt seo ar Twitter" />
                                </span>
                            </xsl:element>
                            <xsl:element name="a">
                                <xsl:attribute name="class">
                                    <xsl:text>emailSharer</xsl:text>
                                </xsl:attribute>
                                <xsl:attribute name="href">
                                    <xsl:text>mailto:?subject=</xsl:text>
                                    <xsl:value-of select="//tei:titleStmt/tei:title[@xml:lang='en']"/>
                                    <xsl:text>&amp;body=https://old.comhartaighde.ie%2feagrain%2f</xsl:text>
                                    <xsl:value-of select="//tei:editionStmt/tei:edition/@n"/>
                                    <xsl:text>%2f</xsl:text>
                                    <xsl:value-of select="//ct:identifier"/>
                                    <xsl:text>%2fen%2f</xsl:text>
                                </xsl:attribute>
                                <xsl:attribute name="target">
                                    <xsl:text>_blank</xsl:text>
                                </xsl:attribute>
                                <span class="shareIcon emailShare">
                                    <img srcset="/img/email-share-dubh.png, /img/email-share-dubh-2x.png 2x" alt="Scaip an t-alt seo ar an ríomhphost" />
                                </span>
                            </xsl:element>
                        </li>
                    </ul>                    
                    <a class="link-alt-lang" href="../">Gaeilge »</a>
                </section><!--#metadata-->
                
                <div class="inner" role="main">
                    
                    <section id="abstract" class="no-path">
                        <xsl:apply-templates select="//tei:div[@type='abstract'][@xml:lang='en']"/>
                    </section><!--#abstract-->
                    
                    <section id="articleContent" role="main">
                        <div class="en-statement">
                            <p class="title">Please note</p>
                            <p>COMHAR<i>Taighde</i> is an open access, peer-reviewed scholarly journal in the field of Irish language and literature studies.  The full text of the article described on this page is available in the Irish language only. English-language translations of article titles, abstracts and certain metadata are provided in order to enable international scholars to discover research published in COMHAR<i>Taighde</i> and to facilitate the indexing of articles in certain academic databases.</p>
                            <p><a href="../">Click here to view the full article text in Irish »</a></p>
                        </div>
                    </section><!--#articleContent-->
                    
                </div><!--.inner-->
                
            </div><!--.row-->
            
        </article>
        
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/footer.php");?</xsl:processing-instruction>
        
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/search-modal.php");?</xsl:processing-instruction>
        
        <!-- jQuery agus an chreatlach fhreagrúil-->
        <xsl:processing-instruction name="php">include($_SERVER["DOCUMENT_ROOT"] . "/includes/global-scripts.php");?</xsl:processing-instruction>
        
        <!--Córas tagartha-->
        <script src="/js/min/alt-min.js"></script>
        
        <!--aibhsiú torthaí cuardaigh-->
        <script>
            $(function () {
                $(document).highlightSearchTerms();
            });
        </script>
        
        <!--Áis chun alt a scaipeadh ar Facebook-->
        <script>
            $('.socialSharing').on('click', '.facebookSharer', function () {
                FB.ui({
                    method: 'share',
                    href: '<xsl:copy-of select="$thisArticleURL"/>en/',
                }, function (response) { });
            });
        </script>
        
    </body>
</html>
    
</xsl:template>
    
</xsl:stylesheet>