Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: comparing nodes in xslt

From: David Carlisle <davidc@---.--.-->
To: NULL
Date: 10/8/2004 12:49:00 AM

You say

  <element name="1"> => <element name="1"><content /></element>

  the example counts this as the same type of element as the ones
  without content.

well yes of course because you (and so I) are only grouping on the name
attribute. If you want to consider something else as being a
distinguishing factor then just include it in the test eg
use
concat(@name,':',count(*))
would distinguish nodes based on their name attribute and the number of
children. I suspect that you want a test that is more like deep-equal 
(which is a predefined function in xpath2) so perhaps your request
> This is a limitation of xslt that I
> believe should be fixed in future revisions.

has been granted in Xpath2. If that is the case you probably can't express that as
a single Xpath in Xpath 1 (without using an extension function,) but you
can certainly express it in xslt1 so you can do the grouping, you
probably just can't use the optimisation of using a key as the key index
needs to be expressed as a single xpath. But keys are only an
optimisation feature anything expressable using keys is expressable
without them (just may take longer to run)

of course any xpath extension that allows xpath functions to be defined
using xslt would allow this kind of key to be used even in an xslt1
context (saxon and the exslt project have such function definition
possibilitiesfor xslt1, and they are a standard part of xslt2 draft)

David


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent