This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Identifying empty elements
- To: xsl-list at mulberrytech dot com
- Subject: Identifying empty elements
- From: Sridhar_Ramachandran at i2 dot com
- Date: Wed, 8 Nov 2000 15:24:33 -0800
- Reply-To: xsl-list at mulberrytech dot com
I have a need to identify empty text-only elements and ignore them. The
input document might contain an element in one or more of the following
forms
<SOME_TAG/>
<SOME_TAG SOME_ATTRIBUTE="some_value"/>
<SOME_TAG> </SOME_TAG>
<SOME_TAG>some_text_here</SOME_TAG>
For my purpose all but the last one above are empty elements and need to
be ignored. Is there a simple mechanism for identifying such elements. The
simple xpath expression
//SOME_TAG[. !=''] ignores just the first two cases, but selects the third
one containing the white-space .
thanks in advance for you help.
rgds
Sridhar
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list