]> granicus.if.org Git - docbook-dsssl/commitdiff
Make sure stripping doesn't delete @{xml:}id values!
authorNorman Walsh <ndw@nwalsh.com>
Tue, 7 Jun 2011 12:09:34 +0000 (12:09 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Tue, 7 Jun 2011 12:09:34 +0000 (12:09 +0000)
xsl/common/stripns.xsl

index e4fbdfd80e7c91365ca019ebfcc014d09535a45b..4b8c1b8a30ea4afc0ce1635b530de4b491bc6c3d 100644 (file)
          <xsl:copy-of select="@*[not(name(.) = 'xml:id')
                               and not(name(.) = 'version')
                               and not(local-name(.) = 'href')]"/>
+          <xsl:if test="@xml:id">
+            <xsl:attribute name="id">
+              <xsl:value-of select="@xml:id"/>
+            </xsl:attribute>
+          </xsl:if>
          <xsl:apply-templates mode="stripNS"/>
        </sgmltag>
       </ulink>
     <xsl:otherwise>
       <sgmltag>
        <xsl:copy-of select="@*[not(name(.) = 'xml:id')
-                            and not(name(.) = 'version')]"/>
+                                and not(name(.) = 'version')]"/>
+          <xsl:if test="@xml:id">
+            <xsl:attribute name="id">
+              <xsl:value-of select="@xml:id"/>
+            </xsl:attribute>
+          </xsl:if>
        <xsl:apply-templates mode="stripNS"/>
       </sgmltag>
     </xsl:otherwise>
       <xsl:copy-of select="@*[not(name(.) = 'xml:id')
                           and not(name(.) = 'version')
                           and not(local-name(.) = 'href')]"/>
+      <xsl:if test="@xml:id">
+        <xsl:attribute name="id">
+          <xsl:value-of select="@xml:id"/>
+        </xsl:attribute>
+      </xsl:if>
       <xsl:apply-templates mode="stripNS"/>
     </citetitle>
   </ulink>
                         and not(name(.) = 'version')
                         and not(name(.) = 'linkend')
                         and not(local-name(.) = 'href')]"/>
+    <xsl:if test="@xml:id">
+      <xsl:attribute name="id">
+        <xsl:value-of select="@xml:id"/>
+      </xsl:attribute>
+    </xsl:if>
       <xsl:apply-templates mode="stripNS"/>
   </citetitle>
 </xsl:template>