Closed sydb closed 1 year ago
More:
<content>
was mixed, and that’s what I got<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.tei-c.org/ns/1.0"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns:rna="http://relaxng.org/ns/compatibility/annotations/1.0"
xpath-default-namespace="http://www.tei-c.org/ns/1.0"
exclude-result-prefixes="#all"
version="3.0">
<xsl:output method="xml" indent="yes"/>
<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="content[ *[2] ]" as="element(content)">
<xsl:variable name="wrapperGI">
<xsl:choose>
<xsl:when test="tei:* and not( rng:* | rna:* )">sequence</xsl:when>
<xsl:when test="( rng:* | rna:* ) and not( tei:* )">rng:div</xsl:when>
<xsl:otherwise>
<xsl:sequence select="'HUMAN_FIX_THIS'"/>
<xsl:message>ERROR: content element with children that are neither all TEI nor all RELAX NG; contents will be wrapped in an invalid <HUMAN_FIX_THIS> element.</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:element name="{$wrapperGI}">
<xsl:apply-templates select="node()"/>
</xsl:element>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Here is what I did:
<content>
that were either all TEI elements or all RELAX NG elements; also found 2 cases in which there was a mix. I spot-checked 2–3 of each of the former cases and the 2 mixes, too.<constraintSpec ident="only_1_child_of_content">
.<sch:ns>
to TEI.xml (in "c2"), binding the namespace to the prefix “rna:”.make clean validate html-web test exemplars
in the Docker environment.<content>
.Here is what the warning messages look like (whitespace altered for readability) …
2+ TEI children:
2+ RELAX NG children:
2+ children, not all TEI, not all RELAX NG:
What I did not do was use role="warning" on the
<sch:assert>
and<sch:report>
elements. I probably should have, and may well fix that and commit shortly.