RE: [xsl] most efficient way to check for a group of tags?

Subject: RE: [xsl] most efficient way to check for a group of tags?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 2 Mar 2005 21:08:23 -0000
One of the big hopes for schema-aware XSLT 2.0 is that when this situation
arises, its because tag1, tag2, etc are subtypes of some common supertype,
and that you can then change the rule to say

/child::schema-element(xyz)

where xyz is an abstract element with tag1, tag2 etc in its substitution
group. When this works, it should start to enable you to get the same kind
of efficiencies from programming at a more abstract level that are familiar
from object oriented programming.

Sorry if this isn't a practical option in your case - you'll just have to
spell out the list.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Sebastien Boisvert [mailto:sebastienboisvert@xxxxxxxxx] 
> Sent: 02 March 2005 20:38
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] most efficient way to check for a group of tags?
> 
> I've got a template that needs to know the if it
> contains only 1 of a specific group of tags when it's
> within a "content" tag, and I've got this condition to
> do this:
> 
> count(ancestor::content[1]/child::*[self:tag1 or
> self:tag2 or self:tag3 ....]) = 1
> 
> Now I need to check for about 15 different tags; is
> there a more efficient way to do this sort of check?
> 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Celebrate Yahoo!'s 10th Birthday! 
> Yahoo! Netrospective: 100 Moments of the Web 
> http://birthday.yahoo.com/netrospective/

Current Thread