Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failing to handle <desc type="deprecationInfo"> when testing for out-of-date descriptions #635

Closed
sydb opened this issue Oct 16, 2023 · 0 comments
Assignees
Labels

Comments

@sydb
Copy link
Member

sydb commented Oct 16, 2023

I could have sworn we fixed this already, but cannot find an issue or PR about it (whether open or closed).

In common/functions.xsl tei:descOrGlossOutOfDate() is defined as

  <xsl:function name="tei:descOrGlossOutOfDate">
    <xsl:param name="context"/>
    <xsl:for-each select="$context">
      <xsl:variable name="lang" select="tei:generateDocumentationLang(.)[1]"/>
      <xsl:sequence select="tei:desc[@xml:lang='en']/@versionDate gt tei:desc[@xml:lang=$lang]/@versionDate
                         or tei:gloss[@xml:lang='en']/@versionDate gt tei:gloss[@xml:lang=$lang]/@versionDate"></xsl:sequence>
    </xsl:for-each>
  </xsl:function>

In the case of a structure that is being deprecated via @validUntil, it will (or at least should) have both a <desc xml:lang="en"> to describe the thing being described, and a <desc type="deprecationInfo" xml:lang="en">. Thus the XPath on the L side of the 1st gt in the <xsl:sequence> resolves to a sequence of 2 element nodes, and the function dies as gt does not handle sequences.

The fix is to add something like a [not( @type eq 'deprecationInfo') ] predicate to the both the XPaths that seek <desc> elements (on both L and R side of the gt.)

@sydb sydb added this to the Release 7.56.0 milestone Oct 16, 2023
@sydb sydb self-assigned this Oct 16, 2023
sydb added a commit that referenced this issue Oct 16, 2023
Added clause testing for type=deprecationInfo so we don't get 2+ nodes being tested on one side of 'gt'.
@sydb sydb closed this as completed in 611befa Oct 16, 2023
@raffazizzi raffazizzi added this to the Release 7.56.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants