[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How to compare the attributes of two elements to ensur

Subject: How to compare the attributes of two elements to ensure that they are equal
From: Arvind Bassi <arvind_bassi@xxxxxxxxxxx>
Date: Wed, 29 Oct 2003 02:10:22 +0000 (GMT)
compare attributes
What is the best way to compare two elements in terms of their
attributes, and the attribute values? I need to ensure that each
element has the same number of attributes, the same attribute names and
the same attribute values.

I am currently working on a stylesheet which compares two xml
documents, and generates the differences between them. I have used Lar
Huttar's xml document comparison stylesheet as my base (located at
http://www.dpawson.co.uk), but am stuck on augmenting it with checks on

I am currently stuck with something along the lines of:

       <xsl:call-template name="compare-attributes">
          with nodes as parameters
   <xsl:template name="compare-attributes">
        <xsl:param name="attrA"/>
        <xsl:param name="attrB"/>
        <xsl:for-each select="$attrA/@*">
               .... check that the same attribute exists with
               .... the same attribute exists 
               if it does then compare the values for equality


However, l cannot get a handle on each of the two attributes to compare
them. Can somebody help to fill in the blanks?



Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.