Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 19th, 2012, 10:21 AM
Authorized User
 
Join Date: Mar 2012
Posts: 25
Thanks: 9
Thanked 0 Times in 0 Posts
Default Full Comparison of current node and a node stored in a variable

Hi,

I wanted to compare the "current()" node with a node I stored into a variable. I simply tried using <xsl:if test="$var=current()"> but of course it didn't work

I was looking for a solution in forums, but I only found ways to compare the contents of sub-components (childrens, granchildrens etc.) but leaving out the attributes.

What I want is a full match (starting from that node) of the two subtrees.

Thanks in advance for your help
EastvanAxon
 
Old December 19th, 2012, 10:26 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

With XSLT 2.0 there is http://www.w3.org/TR/xpath-functions/#func-deep-equal, perhaps it does what you need.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
The Following User Says Thank You to Martin Honnen For This Useful Post:
EastvanAxon (December 19th, 2012)
 
Old December 19th, 2012, 12:01 PM
Authorized User
 
Join Date: Mar 2012
Posts: 25
Thanks: 9
Thanked 0 Times in 0 Posts
Default

Oh thanks a lot!!!....I realized a second after posting that it was sufficient to search for "xsl subtrees comparison"

Sorry for spamming the forum with my silly question :(

EastvanAxon





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help With Position of Current Node From Root ritagr XSLT 4 August 3rd, 2012 12:54 PM
How to get full path of an XML node? swheeler XML 1 December 11th, 2009 05:28 AM
Displaying data as a Parent Node with Left Node and Right Node Manoj Bisht Visual Basic 2008 Professionals 0 April 2nd, 2009 02:34 AM
Please help to check the current node... darshil XSLT 1 May 9th, 2007 02:42 AM
"for-the-current-node" instead of "for-each" ? webhead XSLT 2 August 25th, 2006 02:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.