Talk:MilestoneXSLT

From TEIWiki
Jump to navigation Jump to search

More comments, please

I found these pieces of code highly useful, but (despite having worked with XSLT before) it took me very long to understand how they actually work, i.e. what some of the expressions actually do. Maybe future readers would benefit from some comments added to the code. --Martin de la Iglesia 05:57, 6 August 2012 (EDT)

Script 2: suggestions for improvement

regarding the 2nd of the XSLT 2.0 stylesheets:

  1. Just a minor point, but I think the line <xsl:variable name="cur-p" select="generate-id(.)"/> is unnecessary, because this variable isn't used anywhere. I assume it's a relict from the XSLT 1.0 version.
  2. The line <xsl:sequence select="current()/ancestor::p[1]/lb/@*"/> doesn't seem entirely correct; more precisely, it only works for the particular example input provided, but not when there are multiple lb elements, in which case only the attribute value of the last lb is applied to each lb element.
  3. Instead, in order to copy the attributes, I suggest to add <source lang="xml"><xsl:copy-of select="@*"/></source> after each of the tags inserted in step2 (p, lb, del), e.g. <source lang="xml">

    <xsl:copy-of select="@*"/></source> etc. Note, however, that this might add unwanted default attributes to the output - see https://listserv.brown.edu/archives/cgi-bin/wa?A2=TEI-L;42710be0.1404 for solutions to this problem.

--Martin de la Iglesia 12:23, 18 April 2018 (CEST)