Altova Mailing List Archives

[xsl] linkdiff template

From: Guy McArthur <guym@--------------->
Date: 6/12/2002 4:28:00 PM
Hi, I'm looking to write a template to output the a/@href's from one 
(newer) file that are *not* present in another (older) file.

I.e. given the following two files
 <a href=">Google!</a>
 <a href="">W3C</a>
 <a href="">W3C</a>
 <a href="">My HomePage</a>
 <a href="">Xalan</a>
The output would be:

Here's my first stab at the stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl="">

 <xsl:param name="previous"/>

 <xsl:key name="links" match="a" use="document($previous)///a/@href"/>
 <xsl:output method="text"/>

 <xsl:template match="a">
   <xsl:if test="not(boolean(key('links', @href)))">
     <xsl:value-of select="@href"/>


However, it is just outputting all the href's (test is always true).
Please enlighten me!

I'm using 'java org.apache.xalan.xslt.Process -IN new.xml -XSL linkdiff.xsl -PARAM previous old.xml'.


 XSL-List info and archive:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.