Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed to hide an xref only when it appears in a p element with a specific attribute
    primarykey
    data
    text
    <p>This is a re-work/new question after I got my previous one quite wrong by asking about the wrong element so here goes...</p> <p>I'm trying to match and hide a xref within the following p element with the attribute of LC LRCaseName:</p> <pre><code>&lt;p outputclass="LC LRCaseName"&gt;&lt;i&gt;Naseem Akhtar v Birmingham City Council&lt;/i&gt; [2011] EWCA Civ 383 &lt;xref href="#Public_PUBLICLAW_PLLR_2011PLLR002"&gt;Click here for transcript&lt;/xref&gt;&lt;/p&gt; </code></pre> <p>so that I end up with "<em>Naseem Akhtar v Birmingham City Council [2011] EWCA Civ 383</em>"</p> <p>We have other xrefs within other p outputclasses that we need to display otherwise I would hide it with &lt;<code>xsl:template match="p/xref"/&gt;</code> as per Dimitre Novatchev 's suggestion.</p> <p>This particular xref will always contain "Click here for transcript" but the href will vary.</p> <p>thanks.</p> <p><strong>EDIT:</strong></p> <p>I have tried the following code which doesn't make the xref background red:</p> <pre><code>&lt;xsl:template match="p[@outputclass='LC LRCaseName']/xref"&gt; &lt;fo:block background-color="red" &gt; &lt;xsl:apply-templates/&gt; &lt;/fo:block&gt; &lt;/xsl:template&gt; </code></pre> <p>but if I use this:</p> <pre><code>&lt;xsl:template match="p[@outputclass='LC LRCaseName']"&gt; &lt;fo:block background-color="red" &gt; &lt;xsl:apply-templates/&gt; &lt;/fo:block&gt; &lt;/xsl:template&gt; </code></pre> <p>It does make the entire P element background red and that includes the xref portion.</p> <p><strong>EDIT 2:</strong></p> <p>I have just had a thought, this system has another xsl file that has matches for xref. I'm wondering if my changes are being over-written by this file. Let me look into this further.</p> <p><strong>EDIT 3:</strong></p> <p>Just placed this very same code </p> <pre><code>&lt;xsl:template match="p[@outputclass='LC LRCaseName']/xref" /&gt; </code></pre> <p>into dita2fo-links.xsl rather than the current file I was working on (dita2fo-elems.xsl) and it worked straight away. Obviously the links file is processed after the elems and all my matching was being overwritten by the later template matches.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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