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

comparing attributes values dynamically

Subject: comparing attributes values dynamically
From: Adam Foran <aforan@xxxxxxxxx>
Date: Mon, 5 Jan 2004 10:30:36 -0500
adam foran
Hi,

I think I've got hung up a bit on some XSLT syntax
that I'm hoping someone here can help me with. I've
tried to both Google and FAQ reading, but haven't found
anything that's helped.

I'm trying to compare two versions of the 'same' node
(one pulled out of an old version of my xml file using
document()) and want to iterate through and compare all
the values of all the attributes. I'd like to avoid
having to hard-code in any attribute names.

My XSLT code has a template into which I pass the two
nodes in $newNode and $oldNode but I'm getting compilation
errors. I know the following code is wrong but hopefully
it'll be obvious what I'm trying to accomplish with it:

<xsl:for-each select="$newNode/@*">
  <xsl:if test="string(current()) = $oldNode/@{name()}">
                {_______________}   {________________}
                        ^                  ^
                        |                  |
           the value of the current        |
           attribute                       |
                                           |
           the value of the attribute in $oldNode with the
           same name() as current() (ie. the 'same' sttribute
           in $oldNode)

The test expression fails to compile, but I'm having
difficulty figuring out how to use the result of name()
to specify the attribute to use from the $oldNode.

Thanks very much for any help,

Adam

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.