<fo:page-number-citation ref-id="{$id}"/>
</fo:basic-link>
- <xsl:if test="key('endofrange', @id)[&scope;]">
- <xsl:apply-templates select="key('endofrange', @id)[&scope;][last()]"
+ <xsl:if test="key('endofrange', $id)[&scope;]">
+ <xsl:apply-templates select="key('endofrange', $id)[&scope;][last()]"
mode="reference">
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
</xsl:when>
<xsl:otherwise>
<xsl:text><phrase role="pageno"></xsl:text>
- <xsl:if test="@id">
+ <xsl:if test="$id">
<xsl:text><link linkend="</xsl:text>
<xsl:value-of select="$id"/>
<xsl:text>"></xsl:text>
<fo:basic-link internal-destination="{$id}">
<fo:page-number-citation ref-id="{$id}"/>
</fo:basic-link>
- <xsl:if test="@id">
+ <xsl:if test="$id">
<xsl:text></link></xsl:text>
</xsl:if>
<xsl:text></phrase> </xsl:text>
</xsl:variable>
<xsl:text><phrase fole="pageno"></xsl:text>
- <xsl:if test="$target[1]/@id">
+ <xsl:if test="$target[1]/@id or $target[1]/@xml:id">
<xsl:text><link linkend="</xsl:text>
<xsl:value-of select="$id"/>
<xsl:text>"></xsl:text>
<fo:basic-link internal-destination="{$id}">
<fo:page-number-citation ref-id="{$id}"/>
</fo:basic-link>
- <xsl:if test="$target[1]/@id">
+ <xsl:if test="$target[1]/@id or $target[1]/@xml:id">
<xsl:text></link></xsl:text>
</xsl:if>
<xsl:text></phrase> </xsl:text>
</xsl:variable>
<xsl:text><phrase role="pageno"></xsl:text>
- <xsl:if test="$target[1]/@id">
+ <xsl:if test="$target[1]/@id or target[1]/@xml:id">
<xsl:text><link linkend="</xsl:text>
<xsl:value-of select="$id"/>
<xsl:text>"></xsl:text>
<fo:basic-link internal-destination="{$id}">
<fo:page-number-citation ref-id="{$id}"/>
</fo:basic-link>
- <xsl:if test="$target[1]/@id">
+ <xsl:if test="$target[1]/@id or target[1]/@xml:id">
<xsl:text></link></xsl:text>
</xsl:if>
<xsl:text></phrase> </xsl:text>
<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/@xreflabel"/>
<xsl:text>] </xsl:text>
</xsl:when>
- <xsl:when test="$node/@id">
+ <xsl:when test="$node/@id or $node/@xml:id">
<xsl:text>[</xsl:text>
- <xsl:value-of select="$node/@id"/>
+ <xsl:value-of select="($node/@id|$node/@xml:id)[1]"/>
<xsl:text>] </xsl:text>
</xsl:when>
<xsl:otherwise><!-- nop --></xsl:otherwise>
<xsl:template name="block.object">
<fo:block>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="simpara">
<fo:block xsl:use-attribute-sets="normal.para.spacing">
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="formalpara">
<fo:block xsl:use-attribute-sets="normal.para.spacing">
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="abstract">
<fo:block xsl:use-attribute-sets="abstract.properties">
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="revhistory">
<fo:table table-layout="fixed" xsl:use-attribute-sets="revhistory.table.properties">
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
<fo:block>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="$revnumber">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Revision'"/>
<xsl:template match="ackno">
<fo:block xsl:use-attribute-sets="normal.para.spacing">
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:template>
<xsl:template match="co">
- <fo:inline id="{@id}">
+ <fo:inline>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="callout-bug"/>
</fo:inline>
</xsl:template>
<!-- "over there" as if it were "right here" -->
<xsl:variable name="co" select="key('id', @linkend)"/>
- <xsl:variable name="id" select="@id"/>
<xsl:choose>
<xsl:when test="not($co)">
<xsl:message>
</xsl:when>
<xsl:otherwise>
<fo:inline>
- <xsl:if test="$id != ''">
- <xsl:attribute name="id">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="$co" mode="callout-bug"/>
</fo:inline>
</xsl:otherwise>
"'aaaccccddeeeeeegggghhiiiiijklllllnnnnooorrrsssstttuuuuuuwyzzzAAACCCCDDEEEEEEGGGGHHIIIIIJKLLLLLNNNNOOORRRSSSSTTTUUUUUUWYYZZZ'"/>
<xsl:template match="*" mode="fop.outline">
- <xsl:if test="@id">
- <fox:destination internal-destination="{@id}"/>
+ <xsl:variable name="id">
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
+ </xsl:variable>
+ <xsl:if test="$id != ''">
+ <fox:destination internal-destination="{$id}"/>
</xsl:if>
<xsl:apply-templates select="*" mode="fop.outline"/>
</xsl:template>
<xsl:choose>
<xsl:when test="$xep.extensions != 0">
<rx:begin-index-range>
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
+ <xsl:call-template name="anchor"/>
<xsl:attribute name="rx:key">
<xsl:value-of select="&primary;"/>
<xsl:if test="@significance='preferred'"><xsl:value-of select="$significant.flag"/></xsl:if>
<xsl:text>???</xsl:text>
</xsl:when>
<xsl:otherwise>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$target"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:attribute name="internal-destination">
- <xsl:value-of select="$target/@id"/>
+ <xsl:value-of select="$id"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</xsl:param>
<fo:inline font-style="italic">
- <xsl:if test="@id">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:apply-templates/>
</xsl:param>
<fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
- <xsl:if test="@id">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:apply-templates/>
</xsl:param>
<fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
- <xsl:if test="@id">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
</xsl:param>
<fo:inline xsl:use-attribute-sets="superscript.properties">
- <xsl:if test="@id">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
</xsl:param>
<fo:inline xsl:use-attribute-sets="subscript.properties">
- <xsl:if test="@id">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
</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>
<fo:basic-link internal-destination="{$id}"
xsl:use-attribute-sets="xref.properties">
<xsl:template match="section">
<xsl:choose>
- <xsl:when test="$rootid = @id">
+ <xsl:when test="$rootid = @id or $rootid = @xml:id">
<xsl:call-template name="section.page.sequence"/>
</xsl:when>
<xsl:otherwise>
<xsl:template match="authorgroup" mode="titlepage.mode">
<fo:wrapper>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates mode="titlepage.mode"/>
</fo:wrapper>
</xsl:template>
<xsl:template match="bookinfo/authorgroup|info/authorgroup"
mode="titlepage.mode" priority="2">
<fo:block>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates mode="titlepage.mode"/>
</fo:block>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="anchor">
- <fo:inline id="{@id}"/>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+ <fo:inline id="{$id}"/>
</xsl:template>
<!-- ==================================================================== -->
<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:template>
<xsl:template match="*" mode="pagenumber.markup">
- <fo:page-number-citation ref-id="{@id}"/>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+ <fo:page-number-citation ref-id="{$id}"/>
</xsl:template>
<!-- ==================================================================== -->