RE: [xsl] Need help finding invalid references to target IDs

Subject: RE: [xsl] Need help finding invalid references to target IDs
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 26 Jun 2008 21:14:58 +0100
> Our schema has numerous elements with "id" attributes (target 
> IDs) 

<xsl:key name="kid" match="*[@id]" use="@id"/>

> and several with "refID" attributes (reference IDs).  
> Unfortunately, these are not defined as ID and IDREF 
> respectively or I wouldn't be having this issue.  I need to 
> compare all of the "refID" attributes in a document against 
> all of the "id" attributes and generate a report showing the 
> "refID" attributes that do not have a valid target. 

<xsl:for-each select="//*[@refID][not(key('kid', @refID)])">
  ...


Michael Kay
http://www.saxonica.com/

Current Thread