]> granicus.if.org Git - docbook-dsssl/commitdiff
Finish support for @xml:id everywhere @id is used.
authorBob Stayton <bobs@sagehill.net>
Sun, 12 Nov 2006 08:23:54 +0000 (08:23 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 12 Nov 2006 08:23:54 +0000 (08:23 +0000)
16 files changed:
xsl/html/annotations.xsl
xsl/html/autoidx.xsl
xsl/html/biblio.xsl
xsl/html/callout.xsl
xsl/html/chunk-code.xsl
xsl/html/chunk-common.xsl
xsl/html/chunker.xsl
xsl/html/chunkfast.xsl
xsl/html/formal.xsl
xsl/html/graphics.xsl
xsl/html/html-rtf.xsl
xsl/html/inline.xsl
xsl/html/maketoc.xsl
xsl/html/synop.xsl
xsl/html/table.xsl
xsl/html/xref.xsl

index 69f35e382c036081826eca7807f489cfe963f260..f9889938523143de3a0277674ec2bc9dfe54c810 100644 (file)
@@ -8,7 +8,7 @@
     <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>
index 8da12de6aa86d8de97b73adfb4b5e6a4fae59fbd..ee38ddffd1012f714237f1da94b76802e65dc493 100644 (file)
          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"/>
index 40c7668f634eb1506bffa7d7cb56ecbed2431b7b..41604154779f0c1000d8f348eec358be427dc6b5 100644 (file)
@@ -91,7 +91,8 @@
   <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>
index 25ce7ae88efdfa9ab30eda5d33c24383654165f5..497c2ca5ebc426c42f033483aa8c067891b0f22f 100644 (file)
@@ -93,9 +93,9 @@
   <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">
index 28f416cad2701b6b8ed1fe23af917f2e2c4b89ad..8e8f4e709fd915f170c0d2ba71f324a355d8b970 100644 (file)
       <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::*">
index 719308cd9e2ca8aa061f0114cd379d1e0d2cf233..33c3947414fc7e2fa9f3cb1e68dc369fc0f2d969 100644 (file)
       </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>
index 7bd2bc2984418898b3ed3b30744753594ce32152..e5d124e00ca7a305de2b232e284e5d9334ad9af7 100644 (file)
       <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>
index 42fd7588b13f62cdd510349926d776c7f055a091..d1caf99cf8d994348d6b2637eaaff8bd05cdcbb0 100644 (file)
     <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::*">
index 8ccb1f3578f9b4806ece72621cbfe98f86899937..516dcdb138507ff9e8b5483a9fd032497ee4a075 100644 (file)
     </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>
index 83949245826c5f32c6a94b425e14cb5bf5afb2d5..76c005988cee7c32061f123d12e57a3a12808c17 100644 (file)
@@ -1011,8 +1011,7 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:if test="@id">
-    <a name="{@id}"/>
+  <xsl:call-template name="anchor"/>
   </xsl:if>
 
   <xsl:choose>
@@ -1073,9 +1072,7 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
         <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"/>
@@ -1084,9 +1081,7 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
 
 <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>
@@ -1100,9 +1095,7 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
 <!-- ==================================================================== -->
 
 <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>
index dbf4c98207378d877c3571344e3fda7838403c65..5b30c702526e9b279cf16fb4467298190b0f470b 100644 (file)
         <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'">
index 901d2b0557e6e48aa50399d30fdcc4376a58ab37..2b9febab3bc7b55716d621433622813ae225282a 100644 (file)
       <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>
 
index d4d63fbec897dee8bde3dab98250a88f41d97bf8..350cd538eaec8570f97c1ca08f6e9b4d366574cb 100644 (file)
 
   <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"/>
index 0b61fb2604d2e4bf5751d811fff072afb0e417ac..a9b32db71fd6bd81daf3dafaf4e491212373a2f4 100644 (file)
     <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>
index 96d0391b88605c934ca3cb46fc37c40b0e2aaa62..09a93bbb07fdf69e47d1a6bb0691af4056c8b5d2 100644 (file)
           </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>
index 412b93ad23f463408f2bcd70381da727791fdb30..c8ca7d85adc122ae847cfe3bc63cbab0d88b4c45 100644 (file)
       <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>