Sign In/My Account | View Cart  
advertisement

Article:
 Seeking Equality
Subject: When = is not equality
Date: 2005-06-08 19:41:38
From: gmwils

Your comment on "The result shows that it considers the two node sets to be "equal"" for the XSLT 1.0 node set case doesn't make sense to me.


As XSLT is a declaritive language, the following statement:


b/d = c/d


Is really asking, does there exist elements in the collections 'b' and 'c' such that the constraint b/d = c/d is satisified.


If I wanted to ensure that the node sets were actually equal, I would expect to have to do a member by member comparision, which is what the deep-equal operator simplifies.


The article makes it sound like XSLT is doing the "wrong" thing, when it is just slightly different semantics from what would be expected from a procedural language.


No Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Oldest First
  • When = is not equality
    2005-06-08 20:24:40 Bob DuCharme [Reply]

    That's true. I quoted the word "equal" because the declarative nature of XSLT means that the equals sign here doesn't actually mean "equal" but something else.


    Of course, in many procedural languages, it's the assignment statement, but most programmers are used to that. Something that's perfectly typical in a declarative language can seem like an odd quirk to people who are used to procedural languages, and that's most programmers.



Sponsored By: