Subject: RE: [xsl] Equals (=) From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Wed, 26 Sep 2001 11:23:39 +0100 |
> 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? > No; the meaning of this construct is to compare the string value of element1 with the string value of element2. Saxon implements it by getting the string value of both elements and comparing them. Saxon's internal routine to walk all the descendant text nodes of an element to assemble its string value is going to be a lot more efficient than doing the same thing at stylesheet level. But note, it's possible for two elements to have the same string value and yet not have the same structural content, for example <element>text</element> is "equal" to <element><x>text</x></element> Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Equals (=), Wendell Piez | Thread | [xsl] Tokenising the string using x, Avula, Raj |
RE: [xsl] Embedded Stylesheets, Bas Alberts | Date | [xsl] combining two xml documents, Ian Rogers |
Month |