This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Equals (=)


Matt--

At 03:43 PM 9/25/01, you wrote:
>Hello all,
>      I am sure this question is implementation-specific, and probably just
>for my own knowledge, but perhaps a generalized response is possible.
>
>      How does XSL compare two elements to see if they are equal?
>i.e. <xsl:if test = "$element1=$element2>
>
>In my current situation(comparing using Saxon), doing this seems to be
>tremendously faster than comparing all of the children of element1 and
>element2.  My assumption is that the parser hashes up each element and
>compares them.  Is this correct?

Not exactly. It's only comparing string values of the nodes. And no, it's 
not implementation-specific. (How it's done internally may be, but the 
rules of what constitutes "equal" are not.)

The XPath spec [3.4] is really the place to go for this: it's a bit 
complex, but clearly enough explained. You need to know that the value of 
an element node is the concatenation of the values of its text node 
descendants.

Cheers,
Wendell

======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]