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

allow text content in <date> #6

Open
jjarosch opened this issue Jan 15, 2025 · 0 comments
Open

allow text content in <date> #6

jjarosch opened this issue Jan 15, 2025 · 0 comments
Milestone

Comments

@jjarosch
Copy link
Collaborator

cf. TEI-Correspondence-SIG/CMIF#37

Is a <date> with only text content and no attribute ok?

<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>

@jjarosch jjarosch added this to the CMIF v 1.1 milestone Jan 15, 2025
@jjarosch jjarosch assigned jjarosch and unassigned jjarosch Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant