|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XPath: better way to check for text nodes that are
[ Lars Huttar]
> Tom Passim wrote:
> > You could use
> >
> > test='not(.//*[local-name() != "vernac" and local-name() !=
> > "gloss"]/text()[1]
> > | text())'
>
> Hmm... I don't think this would give the correct result in all cases,
> e.g. if we have
> ./llcd:vernac/llcd:stretch/text()
> this should be legal, but it would show up as illegal by your test.
>
Oh, yes, I read your criterion as "children" but you really wrote
"descendants". If llcd:vernac and llcd:gloss could only be immediate
children of the current node, then you could just change it to this -
count(*[local-name() != "vernac"
and local-name() !="gloss"]//text()[1]
| text())
Otherwise this kind of approach gets more complicated and one of the
other suggestions already posted would be better.
As to efficiency, that is likely to be very processor-dependent since it
may depend on optimizations. You would need to test to be sure.
Cheers,
Tom P
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








