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

accessing different nodes when comparing two xml files

Subject: accessing different nodes when comparing two xml files
From: RahilQ <qamar_rahil@xxxxxxxxxxx>
Date: Mon, 25 Apr 2005 14:30:23 +0100
comparing two xml files
Hi

I am comparing two xml files in one xsl file for content equality.

I have declared two variables that will contain the two document trees.

   <xsl:variable name="first">First.xml</xsl:variable>
   <xsl:variable name="second" select="document('Second.xml')/Top"/>

When trying to run a for-loop (as below) I get a compile-time error that 'the result is a node() instead of a boolean' :

<xsl:for-each select="$first/following-sibling::SubConcepts/SubConcept[@name=$firstName]/Value | $first/preceding-sibling::SubConcepts/SubConcept[@name=$firstName]/Value">

<xsl:if test="$second/following-sibling::SubConcepts/SubConcept[@name=$secondName] | $second/preceding-sibling::SubConcepts/SubConcept[@name=$secondName]">

   .............</xsl:if>
.........</xsl:for-each>

Could someone please suggest the best way of writing a code for looping.

PS: I need to access the 'first' and 'second' variables at different points in the same file, which is why I felt that using the $first/.... and $second/... when required will be most convenient.

Thanks in advance for any help
Rahil

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.