I thought we'd fixed every conceivable colour combination issue in the three volumes... but I've come across one I can't seem to resolve in volume 3. Apologies!
Transform liv_000101_0108.xml and go down to 0121. On line 13 you'll see that the word 'case' has been struck out. The word should be black and struck through with a gray line, but instead it is appearing in Charles' brown colour (thought correctly struck through in gray).
The issue is that this gray deletion is inside an add in DL's hand, which is inside a div by CL. DL's words usually appear black when they're in a CL div without any issue. But there is a rule in the xslt file, saying that when a word is struck through in gray in a CL div, the word should appear as brown (CL's default colour) struck through in gray. This means that even though the word has been added by DL and you would think it would appear black, the specific rule is taking precedence. The relevant rule is on line 588 in the xslt vol 3 file (transcription-mt3.xsl): <xsl:when test="@rend='gray' and ancestor::div[@n='CL']">.
I think that the solution lies in creating a rule saying that where a word is struck through in gray, inside an add by DL, within a div by Charles, it should appear as black with a gray line through it. I think this requires a combination of parent and ancestor, but I can't get it to work...
You can see my most recent attempt, commented out, beginning on line 604 in the volume 3 xslt file (using parent::add[@n='DL'] and ancestor::div[@n='CL']). It might be necessary to do something like add rend="black" to the xml (for the words added by DL) and make a rule for words rendered black and struck out in gray.
The complexity of this one definitely makes my head spin!
That said, I appear to have fixed this quite easily taking the problematic rule and putting it all the way at the end of the list of relevant rules.
In short, I think the XSLT takes the rule that it comes to first and applies that as a first priority. So you should move the rule back from where I put it, but just be sure to put it after the rule you want to take precedence and then it should all work like you want it still.
Haha, I know, right! Even trying to describe the problem nearly sent me over the edge!
But you've hit on the solution. I'd wondered if priorities might do it – but found you can't use them with xsl:when. I hadn't realised that the order of the rules was also the order of priority... Dumb of me. I should have thought of that!
In the end, moving the problem rule wasn't enough since it had the effect of messing up colour combinations elsewhere. But adding a new rule: <xsl:when test="@rend='gray' and ancestor::add[@n='DL']"> and then putting it higher up the list of rules seems to have done the trick.
I've only added it to the vol 3 xslt file in case it is messing other stuff up that I haven't found yet (and I don't want to ruin anything in vols 1 and 2).
I thought we'd fixed every conceivable colour combination issue in the three volumes... but I've come across one I can't seem to resolve in volume 3. Apologies!
Transform liv_000101_0108.xml and go down to 0121. On line 13 you'll see that the word 'case' has been struck out. The word should be black and struck through with a gray line, but instead it is appearing in Charles' brown colour (thought correctly struck through in gray).
The issue is that this gray deletion is inside an
add
in DL's hand, which is inside adiv
by CL. DL's words usually appear black when they're in a CLdiv
without any issue. But there is a rule in the xslt file, saying that when a word is struck through in gray in a CLdiv
, the word should appear as brown (CL's default colour) struck through in gray. This means that even though the word has been added by DL and you would think it would appear black, the specific rule is taking precedence. The relevant rule is on line 588 in the xslt vol 3 file (transcription-mt3.xsl):<xsl:when test="@rend='gray' and ancestor::div[@n='CL']">
.I think that the solution lies in creating a rule saying that where a word is struck through in gray, inside an
add
by DL, within adiv
by Charles, it should appear as black with a gray line through it. I think this requires a combination of parent and ancestor, but I can't get it to work...You can see my most recent attempt, commented out, beginning on line 604 in the volume 3 xslt file (using
parent::add[@n='DL']
andancestor::div[@n='CL']
). It might be necessary to do something like addrend="black"
to the xml (for the words added by DL) and make a rule for words rendered black and struck out in gray.Thanks for your help!
The complexity of this one definitely makes my head spin!
That said, I appear to have fixed this quite easily taking the problematic rule and putting it all the way at the end of the list of relevant rules.
In short, I think the XSLT takes the rule that it comes to first and applies that as a first priority. So you should move the rule back from where I put it, but just be sure to put it after the rule you want to take precedence and then it should all work like you want it still.
Haha, I know, right! Even trying to describe the problem nearly sent me over the edge!
But you've hit on the solution. I'd wondered if priorities might do it – but found you can't use them with
xsl:when
. I hadn't realised that the order of the rules was also the order of priority... Dumb of me. I should have thought of that!In the end, moving the problem rule wasn't enough since it had the effect of messing up colour combinations elsewhere. But adding a new rule:
<xsl:when test="@rend='gray' and ancestor::add[@n='DL']">
and then putting it higher up the list of rules seems to have done the trick.I've only added it to the vol 3 xslt file in case it is messing other stuff up that I haven't found yet (and I don't want to ruin anything in vols 1 and 2).
Thanks Adrian!