xsl-list
[Top] [All Lists]

RE: detecting if a given node contains other nodes from a different namespace or plain text only?

2004-09-08 13:53:31
I'm not sure where the "only" belongs in your sentence. If the element has
no descendants, does it pass or fail?

Let's suppose you mean "test whether every descendant of the current element
is either a text node or an element in a different namespace".

Invert the condition: it's false if the element contains another element in
the same namespace, or a comment, or a processing instruction.

test="not(.//*[namespace-uri()=namespace-uri(current())] 
          or .//comment()
          or .//processing-instruction())"

Michael Kay

-----Original Message-----
From: SANWAL, ABHISHEK (HP-Houston) 
[mailto:abhishek(_dot_)sanwal(_at_)hp(_dot_)com] 
Sent: 08 September 2004 20:40
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] detecting if a given node contains other nodes 
from a different namespace or plain text only?

Detecting if a given node contains other nodes from a different
namespace or plain text only?

How can I do that?

I believe it could be done using the text() and node() functions...

Suggestions?

Thanks in advance.

Abhishek

--+------------------------------------------------------------------
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>
--+--





<Prev in Thread] Current Thread [Next in Thread>