<xsl:with-param name="record-id" select="$record-id" />
</xsl:call-template>
- <!-- Add P19 (lieu de mort) -->
+ <!-- Add P20 (lieu de mort) -->
<xsl:call-template name="generate-P20">
<xsl:with-param name="element-id" select="$element-id" />
<xsl:with-param name="record-id" select="$record-id" />
<xsl:for-each select="$strings-fix-doc">
<xsl:for-each select="key('fix-by-id', $record-id)">
<xsl:for-each select="fix[@type='subtitle']">
- <wdef:value>
- <xsl:variable name="value-id" select="concat($property-id, '-V', count(preceding-sibling::fix[type='title']) + 1)" />
- <xsl:attribute name="wdef:id">
- <xsl:value-of select="$value-id" />
- </xsl:attribute>
- <wdef:translation>
- <xsl:attribute name="xml:lang">
- <xsl:value-of select="@xml:lang" />
+ <xsl:if test=". != ''">
+ <wdef:value>
+ <xsl:variable name="value-id" select="concat($property-id, '-V', count(preceding-sibling::fix[type='title']) + 1)" />
+ <xsl:attribute name="wdef:id">
+ <xsl:value-of select="$value-id" />
</xsl:attribute>
- <xsl:value-of select="." />
- </wdef:translation>
- </wdef:value>
+ <wdef:translation>
+ <xsl:attribute name="xml:lang">
+ <xsl:value-of select="@xml:lang" />
+ </xsl:attribute>
+ <xsl:value-of select="." />
+ </wdef:translation>
+ </wdef:value>
+ </xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
- <xsl:when test="$place-370a != ''">
+ <xsl:when test="$place-qid != ''">
<wdef:property>
<xsl:variable name="property-id">
<xsl:call-template name="get-property-id">
</wdef:property>
</xsl:when>
<xsl:otherwise>
- <xsl:message terminate="yes">
+ <xsl:message terminate="no">
<xsl:value-of select="$record-id" />
<xsl:text> : pas d’équivalent répertorié pour le lieu suivant : « </xsl:text>
<xsl:value-of select="$place-370a" />
</xsl:attribute>
<xsl:for-each select="$occupations-qids">
- <xsl:if test="generate-id($occupations-qids[@qid][1]) = generate-id($occupations-qids)">
+ <xsl:if test="@qid != '' and generate-id($occupations-qids[@qid][1]) = generate-id($occupations-qids)">
<wdef:value>
<xsl:variable name="value-id" select="concat($property-id, '-V', generate-id($occupations-qids))" />
<xsl:attribute name="wdef:id">
</xsl:variable>
<xsl:variable name="normalized-date">
- <xsl:value-of select="normalize-space($date-extracted)" />
+ <xsl:value-of select="translate(normalize-space($date-extracted), '#u|', '')" />
</xsl:variable>
<!-- Sanity check - YYYY, YYYYMM or YYYYMMDD only -->
<xsl:value-of select="concat(substring($normalized-date, 1, 4), '-', substring($normalized-date, 5, 2), '-', substring($normalized-date, 7, 2))" />
</xsl:when>
<xsl:otherwise>
- <xsl:message terminate="yes">
+ <xsl:message terminate="no">
<xsl:value-of select="$record-id" />
<xsl:text> : date de publication extraite invalide (</xsl:text>
<xsl:value-of select="$date-extracted" />
</xsl:variable>
<xsl:variable name="normalized-date">
- <xsl:value-of select="normalize-space($date-extracted)" />
+ <xsl:value-of select="translate(normalize-space($date-extracted), '#u|', '')" />
</xsl:variable>
<!-- Sanity check - YYYY only -->
<xsl:value-of select="$normalized-date" />
</xsl:when>
<xsl:otherwise>
- <xsl:message terminate="yes">
+ <xsl:message terminate="no">
<xsl:value-of select="$record-id" />
<xsl:text> : année de publication extraite invalide (</xsl:text>
<xsl:value-of select="$date-extracted" />