Skip to content

Commit 510fbe5

Browse files
committed
[bugfix] Replace URI in idno if it is a placeholder from a new document, otherwise append
1 parent aa205eb commit 510fbe5

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

src/main/xar-resources/services/manuforma-form-to-tei.xslt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,23 @@
7676

7777
<xsl:template match="tei:idno[parent::tei:publicationStmt]">
7878
<xsl:copy>
79-
<xsl:apply-templates select="node()|@*"/>
80-
<xsl:if test="$new">
81-
<xsl:value-of select="$uri"/>
82-
</xsl:if>
79+
<xsl:apply-templates select="@*"/>
80+
<xsl:choose>
81+
<xsl:when test="$new">
82+
<xsl:choose>
83+
<xsl:when test="starts-with($uri, .)">
84+
<xsl:value-of select="$uri"/>
85+
</xsl:when>
86+
<xsl:otherwise>
87+
<xsl:apply-templates select="node()"/>
88+
<xsl:value-of select="$uri"/>
89+
</xsl:otherwise>
90+
</xsl:choose>
91+
</xsl:when>
92+
<xsl:otherwise>
93+
<xsl:apply-templates select="node()"/>
94+
</xsl:otherwise>
95+
</xsl:choose>
8396
</xsl:copy>
8497
</xsl:template>
8598

0 commit comments

Comments
 (0)