On Tue, 2022-02-08 at 14:08 -0800, Irene Vagionakis wrote:
> You are right, I should have added a `@mode` attribute to limit the
> `<xsl:template match="t:ptr[ancestor::t:bibl][@target]">` to the
> 'sample' template (whereas now it is called also outside it), but I
> am not very practical with `@mode`. Could anyone who is able to use
> `@mode` properly add it, or otherwise comment that lines out (ll.
> 494-496 of htm-tpl-struct-sample.xsl)?
I've looked a little at this and I don't have enough information to
proceed.
The struct-* XSLT should, I think, contain only named or moded
templates. By (my) preference only named temples, indeed, unless you're
overriding general display in very specific contexts (because otherwise
you either are applying the mode to a bunch of material you haven't
written templates for, or you're repeating a lot of existing code with
the only difference being the mode).
t:ptr isn't applied to directly in the sample XSLT, so I can't simply
add a mode to that template (and to all of the xsl:apply-templates in
the named templates) - that will remove the standard rendering from
everything else.
But really, the struct-* XSLT are for the overall structure of the
display and not for the fine details. Those should go in the
appropriate XSLT for the type of markup, and if distinctions need to be
made there based on the structure, then the following construction is
used:
<xsl:template ...>
...
<xsl:param name="parm-edn-structure" required="no" tunnel="yes"/>
...
<xsl:choose>
...
<xsl:when test="$parm-edn-structure = (...)">
...
</xsl:when>
...
</xsl:choose>
...
</xsl:template>
You can see an example of this in teigap.xsl, among other places.
I hope this helps!
Jamie