Subject: RE: [xsl] XPath: better way to check for text nodes that aren't descendents of x or y nodes? From: "Passin, Tom" <tpassin@xxxxxxxxxxxx> Date: Wed, 14 May 2003 13:20:07 -0400 |
[ Lars Huttar] > But is there a more efficient way to do this? > Something that checks for llcd:vernac|llcd:gloss along the way, > instead of going down the descendant axis and then back up the > ancestor axis (twice)? Something along the lines of > test="./(not(llcd:vernac|llcd:gloss)/)*/text()" > where * means "0 or more times". > You could use test='not(.//*[local-name() != "vernac" and local-name() != "gloss"]/text()[1] | text())' or test='count(.//*[local-name() != "vernac" and local-name() != "gloss"]/text()[1] | text()) > 0' These might be more efficient because you do not bother to examine elements that will not cause a false result, and of the ones that are examined, you only have to look at one text node. Whatever expression you use, remember to use <xsl:strip-space elements='*'/> Otherwise you will be counting whitespace-only nodes between elements, which you most likely do not intend. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: XPath: better way to chec, Dimitre Novatchev | Thread | RE: [xsl] XPath: better way to chec, Lars Huttar |
Re: [xsl] XSLT - base URL for relat, Mike Brown | Date | Re: [xsl] Using or ignoring Types i, Kurt Cagle - Olywa |
Month |