WWW/2002/ws/ra/edcopies xmlspec.xsl,1.14,1.15

Update of /w3ccvs/WWW/2002/ws/ra/edcopies
In directory hutz:/tmp/cvs-serv27228

Modified Files:
	xmlspec.xsl 
Log Message:
Add a check to verify that all bibl entries are actually used.



Index: xmlspec.xsl
===================================================================
RCS file: /w3ccvs/WWW/2002/ws/ra/edcopies/xmlspec.xsl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- xmlspec.xsl	6 Feb 2010 13:03:36 -0000	1.14
+++ xmlspec.xsl	10 Aug 2010 12:30:52 -0000	1.15
@@ -141,6 +141,7 @@
 
   <xsl:key name="ids" match="*[@id]" use="@id"/>
   <xsl:key name="specrefs" match="specref" use="@ref"/>
+  <xsl:key name="bibrefs" match="bibref" use="@ref"/>
 
   <xsl:output method="xml" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="no" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
 
@@ -306,6 +307,12 @@
   <!-- if there's a key, use it in the <dt>, otherwise use the ID -->
   <!-- if there's an href, add a ref in parens at the end of the text -->
   <xsl:template match="bibl">
+    <xsl:if test="not(key('bibrefs', @id))">
+      <xsl:message>
+        <xsl:text> Unused bibl </xsl:text>
+        <xsl:value-of select='@id'/>
+      </xsl:message>
+    </xsl:if>
     <dt xmlns="http://www.w3.org/1999/xhtml" class="label">
       <xsl:if test="@id">
         <a name="{@id}" id="{@id}"/>

Received on Tuesday, 10 August 2010 12:30:55 UTC