Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Solution: Use Global Variables, like this:</p> <pre><code>&lt;xsl:variable name="A" select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title" /&gt; &lt;xsl:variable name="B" select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author" /&gt; &lt;xsl:variable name="C" select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:sponsor | //tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:funder | //tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:principal | //tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:respStmt | //tei:teiHeader/tei:fileDesc/tei:editionStmt | //tei:teiHeader/tei:fileDesc/tei:extent | //tei:teiHeader/tei:fileDesc/tei:seriesStmt" /&gt; &lt;xsl:variable name="D" select="//tei:teiHeader/tei:fileDesc/tei:notesStmt/tei:note" /&gt; </code></pre> <p>Then later:</p> <pre><code>&lt;xsl:call-template name="writeMetadata"&gt; &lt;xsl:with-param name="rowitems" select="$A" /&gt; &lt;/xsl:call-template&gt; &lt;xsl:call-template name="writeMetadata"&gt; &lt;xsl:with-param name="rowitems" select="$B" /&gt; &lt;/xsl:call-template&gt; &lt;xsl:call-template name="writeMetadata"&gt; &lt;xsl:with-param name="rowitems" select="$C" /&gt; &lt;/xsl:call-template&gt; &lt;xsl:call-template name="writeMetadata"&gt; &lt;xsl:with-param name="rowitems" select="$D" /&gt; &lt;/xsl:call-template&gt; </code></pre> <p>repeated as often as needed, without needing to repeat the Xpath expressions.</p> <p>(Michael, your comment "People often fail to realise that global variable definitions can reference the source document," posted at dpawson.co.uk, got me looking in the right area.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload