Skip to content

Commit

Permalink
Merge branch '6.13' into 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Apr 24, 2018
2 parents baccad3 + 918cc03 commit e709f99
Showing 1 changed file with 52 additions and 12 deletions.
Expand Up @@ -11,6 +11,10 @@
version="1.0">
<xsl:output indent="yes" encoding="UTF-8"/>

<xsl:key name="ids" match="//anchor[@name]" use="@name"/>
<xsl:key name="ids" match="*[@xhtml:id]" use="@xhtml:id"/>
<xsl:key name="ids" match="//embed[@ezlegacytmp-embed-link-id]" use="@ezlegacytmp-embed-link-id"/>

<xsl:template match="custom">
<xsl:element name="eztemplateinline" namespace="http://docbook.org/ns/docbook">
<xsl:attribute name="name">
Expand Down Expand Up @@ -188,19 +192,37 @@

<xsl:template match="anchor">
<xsl:element name="anchor" namespace="http://docbook.org/ns/docbook">
<xsl:attribute name="xml:id">
<xsl:value-of select="@name"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="count(key('ids', @name)) &gt; 1">
<xsl:attribute name="xml:id">
<xsl:value-of select="concat('duplicated_id_', @name, '_', generate-id(.))"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xml:id">
<xsl:value-of select="@name"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>

<xsl:template match="link">
<xsl:element name="link" namespace="http://docbook.org/ns/docbook">
<xsl:call-template name="addLinkAttributes"/>
<xsl:if test="@xhtml:id">
<xsl:attribute name="xml:id">
<xsl:value-of select="@xhtml:id"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="count(key('ids', @xhtml:id)) &gt; 1">
<xsl:attribute name="xml:id">
<xsl:value-of select="concat('duplicated_id_', @xhtml:id, '_', generate-id(.))"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xml:id">
<xsl:value-of select="@xhtml:id"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="@class">
<xsl:attribute name="ezxhtml:class">
Expand Down Expand Up @@ -511,9 +533,18 @@
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@xhtml:id">
<xsl:attribute name="xml:id">
<xsl:value-of select="@xhtml:id"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="count(key('ids', @xhtml:id)) &gt; 1">
<xsl:attribute name="xml:id">
<xsl:value-of select="concat('duplicated_id_', @xhtml:id, '_', generate-id(.))"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xml:id">
<xsl:value-of select="@xhtml:id"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="@view">
<xsl:attribute name="view">
Expand Down Expand Up @@ -588,9 +619,18 @@
</xsl:attribute>
</xsl:if>
<xsl:if test="@ezlegacytmp-embed-link-id">
<xsl:attribute name="xml:id">
<xsl:value-of select="@ezlegacytmp-embed-link-id"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="count(key('ids', @ezlegacytmp-embed-link-id)) &gt; 1">
<xsl:attribute name="xml:id">
<xsl:value-of select="concat('duplicated_id_', @ezlegacytmp-embed-link-id, '_', generate-id(.))"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xml:id">
<xsl:value-of select="@ezlegacytmp-embed-link-id"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="@ezlegacytmp-embed-link-class">
<xsl:attribute name="ezxhtml:class">
Expand Down

0 comments on commit e709f99

Please sign in to comment.