G. Ken Holman wrote:
At 2007-03-29 10:49 +0200, Abel Braaksma wrote:
and this with QNames:
//tier1/tier2/@*[not(name() = 'ns:exclude-me')]
I think someone should make the observation that the above test is not
namespace-safe.
I should've known, thanks for pointing that out ;)
If you wanted to base the test on the stylesheet use of the "ns"
prefix, one could do:
//tier1/tier2/@*[not(local-name()='exclude-me' and
namespace-uri()=document('')/*/namespace::ns)]
This, though very nice (never thought of that!), does require the XSLT
1.0 processor to support the namespace axis. Not all do that, for
instance, TransformIIX does not, which makes this less-than-ideal for
browser-based transformations (but I don't know what processor the OP uses).
I suppose you could even use the principle of union in:
//tier1/tier2/@*[not(../@ns:exclude-me and
count(.|../@ns:exclude-me)=1)]
Wow, I'm impressed! It took me a minute or so to understand
count(.|../@ns:exclude)=1, but it really is pretty. I often have trouble
with booleans and XSLT, using the union like this would've never
occurred to me.
I favor this one ;)
Any one of those three above would allow the namespace prefix used in
the input instance for the stylesheet "ns" namespace.
I do think your proffered solution for QNames is not appropriate.
Indeed.
-- Abel Braaksma
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--