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

Reverse order of <constraintSpec> and <datatype> in output of odd2odd when merging attributes #675

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions odds/odd2odd.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ of this software, even if advised of the possibility of such damage.
<xsl:key name="odd2odd-SCHEMASPECS" match="tei:schemaSpec" use="@ident"/>
<xsl:key match="tei:moduleSpec" name="odd2odd-MODULES" use="@ident"/>


<!-- all of these use a combination of @ident _and_ @ns (where
present), in case of duplication of names across schemes -->

Expand Down Expand Up @@ -143,7 +142,6 @@ of this software, even if advised of the possibility of such damage.
<xsl:key name="odd2odd-REPLACE" match="tei:macroSpec[@mode eq 'replace']" use="tei:uniqueName(.)"/>
<xsl:key name="odd2odd-REPLACEATT" match="tei:attDef[@mode eq 'replace']" use="concat(../../@ident,'_',@ident)"/>


<xsl:variable name="DEFAULTSOURCE">
<xsl:choose>
<xsl:when test="$defaultSource != ''">
Expand Down Expand Up @@ -195,7 +193,6 @@ of this software, even if advised of the possibility of such damage.
</xsl:choose>
</xsl:function>


<xsl:function name="tei:checkExclude" as="xs:boolean">
<xsl:param name="ident" as="xs:string"/>
<xsl:param name="exc" />
Expand Down Expand Up @@ -346,7 +343,7 @@ of this software, even if advised of the possibility of such damage.
<xsl:variable name="ODD">
<xsl:for-each select="/*">
<xsl:copy>
<xsl:attribute name="xml:base" select="document-uri(/)"/>
<xsl:attribute name="xml:base" select="document-uri(/)"/>
<xsl:copy-of select="@*"/>
<xsl:if test="$useVersionFromTEI='true'">
<xsl:processing-instruction name="TEIVERSION">
Expand Down Expand Up @@ -1271,8 +1268,8 @@ of this software, even if advised of the possibility of such damage.
<xsl:if test="$ORIGINAL/tei:attList">
<attList xmlns="http://www.tei-c.org/ns/1.0">
<xsl:call-template name="odd2odd-processAttributes">
<xsl:with-param name="ORIGINAL" select="$ORIGINAL"/>
<xsl:with-param name="objectName" select="$className"/>
<xsl:with-param name="ORIGINAL" select="$ORIGINAL"/>
<xsl:with-param name="objectName" select="$className"/>
</xsl:call-template>
</attList>
</xsl:if>
Expand Down Expand Up @@ -1642,7 +1639,7 @@ of this software, even if advised of the possibility of such damage.
not(@ident=$ORIGINAL/tei:attList//tei:attDef/@ident)]"/>
<!-- any direct attRef elements -->
<xsl:apply-templates mode="justcopy"
select="tei:attList/tei:attRef"/>
select="tei:attList/tei:attRef"/>
<!-- now look at each of the original object's attributes and see
if we have an update -->
<xsl:for-each select="$ORIGINAL/tei:attList">
Expand Down Expand Up @@ -1773,14 +1770,6 @@ of this software, even if advised of the possibility of such damage.
<xsl:apply-templates mode="justcopy" select="$Old/tei:desc"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$New/tei:constraintSpec">
<xsl:apply-templates mode="justcopy" select="$New/tei:constraintSpec"/>
</xsl:when>
<xsl:when test="$Old/tei:constraintSpec">
<xsl:copy-of select="$Old/tei:constraintSpec"/>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$New/tei:datatype">
<xsl:apply-templates mode="justcopy" select="$New/tei:datatype"/>
Expand All @@ -1790,7 +1779,14 @@ of this software, even if advised of the possibility of such damage.
</xsl:when>
</xsl:choose>
<xsl:choose>

<xsl:when test="$New/tei:constraintSpec">
<xsl:apply-templates mode="justcopy" select="$New/tei:constraintSpec"/>
</xsl:when>
<xsl:when test="$Old/tei:constraintSpec">
<xsl:copy-of select="$Old/tei:constraintSpec"/>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$New/tei:defaultVal">
<xsl:apply-templates mode="justcopy" select="$New/tei:defaultVal"/>
</xsl:when>
Expand Down
Loading