[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: detecting if a given node contains other nodes fro

Subject: RE: detecting if a given node contains other nodes from a different namespace or plain text only?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 8 Sep 2004 21:53:31 +0100
xsl node contains
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.sanwal@xxxxxx] 
> Sent: 08 September 2004 20:40
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.