<xsl:when test="contains($scripts, ' ')">
<script type="text/javascript" src="{substring-before($scripts, ' ')}"/>
<xsl:call-template name="add.annotation.links">
- <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
+ <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="aids">
<xsl:for-each select="//annotation">
<xsl:if test="@annotates=$id
- or starts-with(@annotates, concat($id, ' '))
- or contains(@annotates, concat(' ', $id, ' '))
- or substring(@annotates, string-length(@annotates)-3)
- = concat(' ', $id)">
- <xsl:value-of select="generate-id()"/>
- <xsl:text> </xsl:text>
+ or starts-with(@annotates, concat($id, ' '))
+ or contains(@annotates, concat(' ', $id, ' '))
+ or substring(@annotates, string-length(@annotates)-3)
+ = concat(' ', $id)">
+ <xsl:value-of select="generate-id()"/>
+ <xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="normalize-space(@annotations) != ''">
<xsl:call-template name="annotations-pointed-to">
- <xsl:with-param name="annotations"
- select="normalize-space(@annotations)"/>
+ <xsl:with-param name="annotations"
+ select="normalize-space(@annotations)"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($annotations, ' ')">
<xsl:variable name='a'
- select="key('id', substring-before($annotations, ' '))"/>
+ select="key('id', substring-before($annotations, ' '))"/>
<xsl:if test="$a">
- <xsl:value-of select="generate-id($a)"/>
- <xsl:text> </xsl:text>
+ <xsl:value-of select="generate-id($a)"/>
+ <xsl:text> </xsl:text>
</xsl:if>
<xsl:call-template name="annotations-pointed-to">
- <xsl:with-param name="annotations"
- select="substring-after($annotations, ' ')"/>
+ <xsl:with-param name="annotations"
+ select="substring-after($annotations, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name='a'
- select="key('id', $annotations)"/>
+ select="key('id', $annotations)"/>
<xsl:if test="$a">
- <xsl:value-of select="generate-id($a)"/>
- <xsl:text> </xsl:text>
+ <xsl:value-of select="generate-id($a)"/>
+ <xsl:text> </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:when test="contains($gids, ' ')">
<xsl:variable name="gid" select="substring-before($gids, ' ')"/>
<xsl:apply-templates select="key('gid', $gid)"
- mode="annotation-inline"/>
+ mode="annotation-inline"/>
<xsl:call-template name="apply-annotations-by-gid">
- <xsl:with-param name="gids"
- select="substring-after($gids, ' ')"/>
+ <xsl:with-param name="gids"
+ select="substring-after($gids, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="key('gid', $gids)"
- mode="annotation-inline"/>
+ mode="annotation-inline"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="title">
- <xsl:value-of select="title"/>
+ <xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
- <xsl:text>[Annotation #</xsl:text>
- <xsl:number count="annotation" level="any" format="1"/>
- <xsl:text>]</xsl:text>
+ <xsl:text>[Annotation #</xsl:text>
+ <xsl:number count="annotation" level="any" format="1"/>
+ <xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
</div>
<div class="annotation-close">
<a href="#" onclick="popup_{generate-id(.)}.hidePopup();return false;">
- <img src="{$annotation.graphic.close}" alt="X" border="0"/>
+ <img src="{$annotation.graphic.close}" alt="X" border="0"/>
</a>
</div>
</div>
<div class="annotation-title">
<xsl:choose>
<xsl:when test="title">
- <xsl:apply-templates select="title/node()"/>
+ <xsl:apply-templates select="title/node()"/>
</xsl:when>
<xsl:otherwise>
- <xsl:text>Annotation</xsl:text>
+ <xsl:text>Annotation</xsl:text>
</xsl:otherwise>
</xsl:choose>
</div>
match="indexterm[see]"
use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see)"/>
-<xsl:key name="sections" match="*[@id]" use="@id"/>
+<xsl:key name="sections" match="*[@id or @xml:id]" use="@id|@xml:id"/>
<xsl:template name="generate-index">
<xsl:value-of select="$title"/> <!-- text only -->
</a>
- <xsl:if test="key('endofrange', @id)[&scope;]">
- <xsl:apply-templates select="key('endofrange', @id)[&scope;][last()]"
+ <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
+ <xsl:if test="key('endofrange', $id)[&scope;]">
+ <xsl:apply-templates select="key('endofrange', $id)[&scope;][last()]"
mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:choose>
<xsl:when test="string(.) = ''">
<xsl:variable name="bib" select="document($bibliography.collection,.)"/>
- <xsl:variable name="entry" select="$bib/bibliography/*[@id=$id][1]"/>
+ <xsl:variable name="entry" select="$bib/bibliography/
+ *[@id=$id or @xml:id=$id][1]"/>
<xsl:choose>
<xsl:when test="$entry">
<xsl:choose>
<xsl:choose>
<xsl:when test="string(.) = ''">
<xsl:variable name="bib" select="document($bibliography.collection,.)"/>
- <xsl:variable name="entry" select="$bib/bibliography/*[@id=$id][1]"/>
+ <xsl:variable name="entry" select="$bib/bibliography/
+ *[@id=$id or @xml:id=$id][1]"/>
<xsl:choose>
<xsl:when test="$entry">
<xsl:choose>
<xsl:value-of select="$node/@id"/>
<xsl:text>] </xsl:text>
</xsl:when>
+ <xsl:when test="$node/@xml:id">
+ <xsl:text>[</xsl:text>
+ <xsl:value-of select="$node/@xml:id"/>
+ <xsl:text>] </xsl:text>
+ </xsl:when>
<xsl:otherwise><!-- nop --></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:choose>
<xsl:when test="$target">
<a>
- <xsl:if test="@id">
+ <xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
<xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
<xsl:variable name="genid" select="generate-id()"/>
- <xsl:variable name="div" select="$chunks[@id=$genid]"/>
+ <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
<xsl:variable name="prevdiv"
select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
- <xsl:variable name="prev" select="key('genid', $prevdiv/@id)"/>
+ <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
<xsl:variable name="nextdiv"
select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
- <xsl:variable name="next" select="key('genid', $nextdiv/@id)"/>
+ <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
<xsl:choose>
<xsl:when test="$onechunk != 0 and parent::*">
</xsl:when>
<!-- if there's no dbhtml filename, and if we're to use IDs as -->
<!-- filenames, then use the ID to generate the filename. -->
- <xsl:when test="@id and $use.id.as.filename != 0">
- <xsl:value-of select="@id"/>
+ <xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
<xsl:if test="name(.) != '' and $suppress-context-node-name = 0">
<xsl:text> for </xsl:text>
<xsl:value-of select="name(.)"/>
- <xsl:if test="@id">
+ <xsl:if test="@id or @xml:id">
<xsl:text>(</xsl:text>
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:if>
<xsl:when test="$chunk.fast != 0 and function-available('exsl:node-set')">
<xsl:variable name="genid" select="generate-id()"/>
- <xsl:variable name="div" select="$chunks[@id=$genid]"/>
+ <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
<xsl:variable name="prevdiv"
select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
- <xsl:variable name="prev" select="key('genid', $prevdiv/@id)"/>
+ <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|prevdiv/@xml:id)[1])"/>
<xsl:variable name="nextdiv"
select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
- <xsl:variable name="next" select="key('genid', $nextdiv/@id)"/>
+ <xsl:variable name="next" select="key('genid', ($nextdiv/@id|prevdiv/@xml:id)[1])"/>
<xsl:choose>
<xsl:when test="$onechunk != 0 and parent::*">
</xsl:when>
<xsl:otherwise>
<xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:if test="not(@id)">
- <xsl:attribute name="id">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:copy-of select="@*[not(local-name()='id')]"/>
+ <xsl:attribute name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:attribute>
<xsl:call-template name="htmlTable"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <xsl:if test="@id">
- <a name="{@id}"/>
+ <xsl:call-template name="anchor"/>
</xsl:if>
<xsl:choose>
<xsl:value-of select="$align"/>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="$object"/>
<xsl:apply-templates select="caption"/>
<xsl:template match="inlinemediaobject">
<span class="{local-name(.)}">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:call-template name="select.mediaobject"/>
</span>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="imageobjectco">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="imageobject"/>
<xsl:apply-templates select="calloutlist"/>
</xsl:template>
<xsl:variable name="leading" select="set:leading($nodes,$block)"/>
<xsl:variable name="trailing" select="set:trailing($nodes,$block)"/>
- <xsl:if test="($wrap/@id and $first = 1) or $leading">
+ <xsl:if test="(($wrap/@id or $wrap/@xml:id)
+ and $first = 1) or $leading">
<xsl:element name="{local-name($wrap)}" namespace="{namespace-uri($wrap)}">
<xsl:for-each select="$wrap/@*">
<xsl:if test="$first != 0 or local-name(.) != 'id'">
</xsl:when>
<xsl:otherwise>
- <xsl:if test="($wrap/@id and $first = 1) or $nodes">
+ <xsl:if test="(($wrap/@id or $wrap/@xml:id) and $first = 1) or $nodes">
<xsl:element name="{local-name($wrap)}" namespace="{namespace-uri($wrap)}">
<xsl:for-each select="$wrap/@*">
<xsl:if test="$first != 0 or local-name(.) != 'id'">
<xsl:choose>
<xsl:when test="$target">
<a>
- <xsl:if test="@id">
+ <xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="id">
- <xsl:choose>
- <xsl:when test="$cterm/@id">
- <xsl:value-of select="$cterm/@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="generate-id($cterm)"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$cterm"/>
+ </xsl:call-template>
</xsl:variable>
<a href="{$chunkbase}#{$id}">
<xsl:call-template name="inline.italicseq">
</xsl:when>
<xsl:otherwise>
<a>
- <xsl:if test="@id">
+ <xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$chunk != 0">
<xsl:call-template name="indent-spaces"/>
- <tocentry linkend="{@id}">
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+ <tocentry linkend="{$id}">
<xsl:processing-instruction name="dbhtml">
<xsl:text>filename="</xsl:text>
<xsl:value-of select="$filename"/>
<xsl:apply-templates select="." mode="synopfragment.number"/>
</xsl:variable>
<p>
- <a name="{@id}">
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+ <a name="{$id}">
<xsl:text>(</xsl:text>
<xsl:value-of select="$snum"/>
<xsl:text>)</xsl:text>
</xsl:attribute>
</xsl:if>
- <xsl:if test="not(preceding-sibling::*) and ancestor::row/@id">
+ <xsl:if test="not(preceding-sibling::*) and
+ (ancestor::row[1]/@id or ancestor::row[1]/@xml:id)">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="ancestor::row[1]"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="(@name and count(@*) = 1)
or (@id and count(@*) = 1)
+ or (@xml:id and count(@*) = 1)
+ or (@xml:id and @name and count(@*) = 2)
or (@id and @name and count(@*) = 2)">
<xsl:message>suppress anchor</xsl:message>
<!-- suppress the whole thing -->
<xsl:copy/>
</xsl:when>
<xsl:otherwise>
- <xsl:message>removing <xsl:value-of select="name(.)"/></xsl:message>
+ <xsl:message>removing <xsl:value-of
+ select="local-name(.)"/></xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:copy>
<xsl:for-each select="@*">
<xsl:choose>
- <xsl:when test="name(.) != 'id'">
+ <xsl:when test="local-name(.) != 'id'">
<xsl:copy/>
</xsl:when>
<xsl:otherwise>
- <xsl:message>removing <xsl:value-of select="name(.)"/></xsl:message>
+ <xsl:message>removing <xsl:value-of
+ select="local-name(.)"/></xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>Don't know what gentext to create for xref to: "</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>", ("</xsl:text>
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:text>")</xsl:text>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="string(.) = ''">
<xsl:variable name="bib" select="document($bibliography.collection,.)"/>
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="entry" select="$bib/bibliography/*[@id=$id][1]"/>
+ <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
+ <xsl:variable name="entry" select="$bib/bibliography/
+ *[@id=$id or @xml:id="$id][1]"/>
<xsl:choose>
<xsl:when test="$entry">
<xsl:choose>
<xsl:apply-templates select="$entry/*[1]"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id:@xml:id)[1]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:text> found in </xsl:text>
<xsl:value-of select="$bibliography.collection"/>
</xsl:message>
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id:@xml:id)[1]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:apply-templates select="*[1]"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id:@xml:id)[1]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
<xsl:apply-templates select="*[1]"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id:@xml:id)[1]"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
</xsl:call-template>
<a>
- <xsl:if test="@id">
- <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="$a.target">
<xsl:attribute name="target"><xsl:value-of select="$a.target"/></xsl:attribute>
<xsl:param name="url" select="@url"/>
<xsl:variable name="link">
<a>
- <xsl:if test="@id">
+ <xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute>
<xsl:variable name="node-href">
<xsl:choose>
<xsl:when test="$localinfo != ''">
- <xsl:variable name="node" select="$outline//*[@id=$localinfo]"/>
+ <xsl:variable name="node" select="$outline//
+ *[@id=$localinfo or @xml:id=$localinfo]"/>
<xsl:value-of select="$node/@href"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="node-xref">
<xsl:choose>
<xsl:when test="$localinfo != ''">
- <xsl:variable name="node" select="$outline//*[@id=$localinfo]"/>
+ <xsl:variable name="node" select="$outline//
+ *[@id=$localinfo or @xml:id=$localinfo]"/>
<xsl:copy-of select="$node/xref"/>
</xsl:when>
<xsl:otherwise>