Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require the user to set both @db:idprefix and @db:idfixup. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions transclusion-fixup.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<xsl:variable name="linkend"
select="if ($hash='#') then substring-after(., '#') else ."/>

<xsl:variable name="xiroot" select="(ancestor-or-self::*[@db:idfixup])[last()]"/>
<xsl:variable name="fixup" select="$xiroot/@db:idfixup"/>
<xsl:variable name="xiroot" select="(ancestor-or-self::*[@db:idfixup or @db:idprefix])[last()]"/>
<xsl:variable name="fixup" select="if($xiroot/@db:idfixup) then $xiroot/@db:idfixup else if($xiroot/@db:idprefix) then 'prefix' else 'none'"/>
<xsl:variable name="linkscope" select="$xiroot/@db:linkscope"/>

<xsl:choose>
Expand Down Expand Up @@ -134,8 +134,8 @@
<xsl:function name="f:trans-id" as="xs:string?">
<xsl:param name="id" as="attribute(xml:id)"/>

<xsl:variable name="xiroot" select="($id/ancestor-or-self::*[@db:idfixup])[last()]"/>
<xsl:variable name="fixup" select="$xiroot/@db:idfixup"/>
<xsl:variable name="xiroot" select="($id/ancestor-or-self::*[@db:idfixup or @db:idprefix])[last()]"/>
<xsl:variable name="fixup" select="if($xiroot/@db:idfixup) then $xiroot/@db:idfixup else if($xiroot/@db:idprefix) then 'prefix' else 'none'"/>

<xsl:choose>
<xsl:when test="empty($fixup) or $fixup='none'">
Expand Down