-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
cf. TEI-Correspondence-SIG/CMIF#37
Is a <date> with only text content and no attribute ok?
cmiferator/library-package/content/correspDesc-transform.xsl
Lines 99 to 113 in 9cd62c0
| <xsl:template match="tei:date[1]"> | |
| <!-- check if any of the dating attributes are present and not empty --> | |
| <xsl:if test="normalize-space(string-join(@when | @notBefore | @notAfter | @from | @to))"> | |
| <date xmlns="http://www.tei-c.org/ns/1.0"> | |
| <!-- only retain allowed attributes --> | |
| <xsl:for-each select="(@when | @notBefore | @notAfter | @from | @to)"> | |
| <!-- only three types of notation are allowed – discard all others --> | |
| <!-- TODO: when none of the attributes conform, the resulting date element is empty --> | |
| <xsl:if test="matches(., '^\d{4}(-\d{2}){0,2}$')"> | |
| <xsl:copy/> | |
| </xsl:if> | |
| </xsl:for-each> | |
| </date> | |
| </xsl:if> | |
| </xsl:template> |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels